How to output number with fixed decimals and with comma instead of period?
See original GitHub issueI am outputing some numbers that needs to be rounded to the first decimal. I am using:
round(num*10)/10;
which gives me 1, 1.1, 1.2 ...
I need to print the 1
also as 1.0
.
Is there an elegant way to do this with CindyJS? In JS it is tofixed()
.
Furthermore, is there a way to output `4,1` instead of `4.1`?
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Change comma to period as default decimal separator
This should be simple. I want Windows 10 to treat my numpad decimal separator as a period, instead of comma (danish default).
Read more >Convert Floating Point Number to String Using a Comma or ...
Choose your decimal point (comma or period), then click on Add New Operation. Choose how you want to format the number from the...
Read more >Decimal Points: Periods or Commas? | Proofed's Writing Tips
Periods or commas for decimal markers? Both are used as decimal markers and this guide will tell you which you should be using....
Read more >How to Convert Comma to Decimal Point & Dot to ... - YouTube
Download the featured file here https://www.bluepecantraining.com/how-to-convert- comma -to- decimal -point- dot -to- comma -in-excel/In this video ...
Read more >How to Change Commas to Decimal Points and Vice Versa in ...
Depending on your country or region, Excel may display decimal points or dots instead of commas for larger numbers. The decimal point (.)...
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
In my opinion, the nicest would be to have a modifier for the
format
command (https://cindyjs.org/ref/String_Operators.html#format$2) that just does this.As a workaround, you could build your own
format
function similar to the functionfmt
in https://cindyjs.org/examples/81_Clock.htmlWhen is the implementation planned? It would be great to have x,y already in production mode 😃 For now it’s still period which might confuse some young students that got used to comma in school.