ability to "pad" a number in formatting
See original GitHub issueSee also: https://github.com/adamwdraper/Numeral-js/issues/123
Which references this implementation: https://gist.github.com/resident-uhlig/7906919
I don’t love the syntax #N#
but at least it works!
Issue Analytics
- State:
- Created 8 years ago
- Comments:6 (5 by maintainers)
Top Results From Across the Web
How to: Pad a Number with Leading Zeros | Microsoft Learn
You can add leading zeros to an integer by using the "D" standard numeric format string with a precision specifier. You can add...
Read more >How to Add Leading Zeros to Numbers or Text with Uneven ...
Solution #2: Padding Numbers or Text with the RIGHT function · Step 1: Add the Leading Zeros. The first step is to add...
Read more >Excel formula: Pad a number with zeros - Excelchat - Got It AI
While working with Excel, we are able to pad a number with zeros by using the TEXT and REPT functions, or by simply...
Read more >Pad a number with leading zeros in JavaScript - Stack Overflow
In JavaScript, I need to have padding. For example, if I have the number 9, it will be "0009". If I have a...
Read more >Quick Tips: Adding Leading Zero to Integer Values (Padding ...
Padding Numbers Greater than 0 with Zero in Power Query. Each format string can have up to 4 sections. We can separate each...
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
FWIW, I’ve worked with other languages/libraries that use the number of digits in the format string as if they were significant-digits; so:
IMO that would be the best possible implementation (seems very clean to me) but I’m not sure how feasible it is to work that into the current formatting implementation, or if it would break any existing expectations at all.
That’s indeed the case.
I will add documentation with the next release.
But if you want to propose a PR before, feel free 😄