Don't strip `.0`-suffix when `secDecimalDigits` is set to `1`
See original GitHub issueI find it kind of confusing that specifying secDecimalDigits: 1
and formatting 1000
will lead to 1s
. If I’m specifying that I want one decimal, I don’t feel like stripping the decimal point makes sense. Especially since it seems that specifying secDecimalDigits: 2
will show .00
.
Is this a concious decision, or an oversight, or somewhere between? 😃 Thoughts?
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (5 by maintainers)
Top Results From Across the Web
number_format - Manual - PHP
The number being formatted. decimals. Sets the number of decimal digits. If 0 , the decimal_separator is omitted from the return value.
Read more >regex - Decimal number regular expression, where digit after ...
If there are any digits present before the decimal sign, then the decimal and the digits following it are optional.
Read more >Using the GNU Compiler Collection
Don't recognize built-in functions that do not begin with '__builtin_' as prefix. See Section 5.50 [Other built-in functions provided by GCC], page 359,...
Read more >Place Value: Decimals - Varsity Tutors
The second digit to the right of the decimal point indicates the number of ... 10 strips of equal size, then each of...
Read more >The OPTMODEL Procedure - SAS Support
OPTMODEL language in SAS data sets that can be submitted to other SAS/OR optimization ... See also the description of the .label suffix...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@sindresorhus Would you accept a PR that takes an option to keep the decimals on whole numbers? I’m using this library for a progress indicator thingy which keeps updating the time spent every ~60ms or so, and it keeps flickering in the terminal when it hits a whole number - I’d prefer if it just kept the fixed length as specified.
@htbkoo https://github.com/sindresorhus/pretty-ms/pull/22