Questions tagged [number-formatting]
Number formatting is the process of converting a numeric value into a string suitable for display. Things to take into account are the decimal/thousands separator, digit grouping, the shape of the numbers, how a percentage or currency is displayed, and so on.
number-formatting
2,877
questions
31
votes
7
answers
49k
views
Excel number format to only show decimals when necessary
How can I, without using formulas, show integers as integers, but decimals limited to a specific number of decimal places?
E.g. show:
1 as 1
12 as 12
but 1.23456789 as 1.23
The number format 0.## is ...
2
votes
1
answer
35
views
How to show more decimal places in histogram axis
I have precision long number array in Octave and I would like to show it in histogram. It basically works well but it only shows a few decimal places on the histogram axis. I need to see more numbers ...
13
votes
2
answers
13k
views
Use `Intl.NumberFormat` with `maximumFractionDigits` and `maximumSignificantDigits` at once
When running
console.log(new Intl.NumberFormat('en-US', {
minimumFractionDigits: 0,
maximumFractionDigits: 0,
maximumSignificantDigits: 3,
minimumSignificantDigits: 1
}).format(10....
48
votes
6
answers
75k
views
Excel Number Format: What is "[$-409]"?
i'm automating excel, using the macro system as a guide to what i should do through automation. When i format a column as a date, the macro generated a NumberFormat for the column to be:
[$-409]m/d/...
0
votes
0
answers
45
views
How to format the numeric value of a cell in Excel using flutter?
I use the Excel library in Flutter Project, there are formatting template classes(NumFormat), but there is no currency formatting to display the ruble or dollar sign.
The library makes it possible to ...
1
vote
1
answer
101
views
Unibyte text buffers in Emacs: encode in hexa?
I have a "text" file that has some invalid byte sequences. Emacs renders these as "\340\360", is there a way to make the mighty text processor render those in hexadecimal, for ...
4
votes
3
answers
11k
views
PHP how to convert number exponential number to string?
I have a number stored in scientific notation
2.01421700079E+14
I've tried using float, string, int and I can't get
0201421700079085 from 2.01421700079E+14
1. echo (float)$awb;
2. echo ...
828
votes
6
answers
1.1m
views
How to output numbers with leading zeros in JavaScript? [duplicate]
Is there a way to prepend leading zeros to numbers so that it results in a string of fixed length? For example, 5 becomes "05" if I specify 2 places.
14
votes
6
answers
30k
views
How to add thousand separator to numbers in pandas
Assuming that I have a pandas dataframe and I want to add thousand separators to all the numbers (integer and float), what is an easy and quick way to do it?
461
votes
37
answers
647k
views
How to format numbers by prepending 0 to single-digit numbers?
I want to format a number to have two digits. The problem is caused when 0–9 is passed, so I need it to be formatted to 00–09.
Is there a number formatter in JavaScript?
3
votes
1
answer
11k
views
Adjust number formatting in Excel via xlwings from python
I have started using xlwings to create an excel tool which calls a python code. I think it is super useful and at the same time user-friendly as everybody is used to have excel as GUI.
Now to my ...
0
votes
1
answer
65
views
MudBlazor MudNumercField with thousand separator
Can I set Format parameter somehow to display the number with thousand separatot in MudNumericField, please. I tried to set it to "n" but it didn't work.
For example: 151 342
2
votes
2
answers
4k
views
How to make thousand separator for a price in Woocommerce
I wrote this code (on woocommerce/single-product/price.php) a few months ago but I lost it, I was lucky to recover the code but in its first phase. Before the result gave me a thousand separation, I ...
2
votes
1
answer
4k
views
Displaying two decimal price rounded with one decimal in Woocommerce
Been working on a message that informs the customer about the shipping and if he/she spends another XX dollars, free shipping will be available.
I've used various hooks as to where this is displayed (...
3
votes
1
answer
2k
views
Exponent notation for Intl.NumberFormat
I'm trying to figure if there's a way for me to use Javascript's Intl.NumberFormat() for creating a square meter value with it.
Say, I would like to use it to create a value like 30 m² with that ...