Forum Discussion
Format Extracted List To Show as Currency (Or Two Decimal Number)
- 4 years ago
If you want to have your list contain values with trailing decimals, as you show, you will need to convert the Number to a text string.
One way to do that is with List.Transform...Number.ToText which will both round the number and show it with two decimals.
List.Transform(decimalList, each Number.ToText(_,"0.00"))Original
Results
One thing that I just noticed.
There are a number of different rounding methods (see this Wikipedia article)
Number.ToRound, by default, uses the so-called "round half to even" method (as does Excel VBA)
The rounding produced by the text function uses, I believe, the "round half away from zero" method (as does regular Excel).
In comparing the two, the Number.Round rounding method can be set explicitly as an optional argument.
So if you wanted to use a particular rounding method other than the default, you could probably round first, then format as text with two decimals.