Forum Discussion
Display FORMAT with millions with one decimal?
Hi all,
I am not able to use FORMAT to display an amount in millions with ONE decimal.
Displaying it with wero decimals works...
You can do some log math here. The format string depends on the number of digits in your actual data point. For example if your data value is 10000 then you need one comma. if the value is 100 then you need zero commas etc.
So - take the log10 of your value, subtract 6 if you are going for millions, integer (floor) divide it by three, and then add the resulting number of commas to your format string.
2 Replies
- AliceW
Power Participant
I found this solution: "#,##,,.0M"
- lbendlin
Super User
You can do some log math here. The format string depends on the number of digits in your actual data point. For example if your data value is 10000 then you need one comma. if the value is 100 then you need zero commas etc.
So - take the log10 of your value, subtract 6 if you are going for millions, integer (floor) divide it by three, and then add the resulting number of commas to your format string.