New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow a decimal format for an integer #222

Merged
merged 1 commit into from Nov 14, 2016

Conversation

Projects
None yet
3 participants
@mguida22
Contributor

mguida22 commented Oct 12, 2016

From #199, when using a decimal format with a wildcard, on an integer, numbro gives an error

numbro(-40).format('#.*');

numbro.js:643 Uncaught TypeError: Cannot read property 'length' of undefined

This addresses the issue by checking for a decimal before attempting to format it. The same line from above will now return '-40'

Show outdated Hide outdated numbro.js Outdated
allow a decimal format for an integer
don't error when an integer is formatted as a decimal with a wildcard.

ex:
`numbro(-40).format('#.*');` will now return `'-40'`

fixes #199, see for more context
@msaglietto

This comment has been minimized.

Show comment
Hide comment
@msaglietto

msaglietto Nov 14, 2016

THanks @mguida22 I think it looks ok now .. what do you think @BenjaminVanRyseghem could we merge this .. I could use it =P ...

msaglietto commented Nov 14, 2016

THanks @mguida22 I think it looks ok now .. what do you think @BenjaminVanRyseghem could we merge this .. I could use it =P ...

@BenjaminVanRyseghem

This comment has been minimized.

Show comment
Hide comment
@BenjaminVanRyseghem

BenjaminVanRyseghem Nov 14, 2016

Owner

thanks 👍

Owner

BenjaminVanRyseghem commented Nov 14, 2016

thanks 👍

@BenjaminVanRyseghem BenjaminVanRyseghem merged commit 5fa21b0 into BenjaminVanRyseghem:develop Nov 14, 2016

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
@mguida22

This comment has been minimized.

Show comment
Hide comment
@mguida22

mguida22 Nov 14, 2016

Contributor

Thanks for the feedback on this!

Contributor

mguida22 commented Nov 14, 2016

Thanks for the feedback on this!

@BenjaminVanRyseghem

This comment has been minimized.

Show comment
Hide comment
@BenjaminVanRyseghem

BenjaminVanRyseghem Mar 27, 2017

Owner

in numbro 1.10.0

Owner

BenjaminVanRyseghem commented Mar 27, 2017

in numbro 1.10.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment