The decimal digits of the currency value displayed by the currency value
When displaying the currency value, accuracy is very important. However, when using the .tring () method to process decimal, too much decimal digits may be generated. In order to limit the output to two decimals, you can consider using a variant of the .tring () method.
The following custom format allows to be zero -level of different degrees:
"#. ##": Only when the value is less than the time, the front guide zero.
The result of
decimalvar.tostring ("#. ##") was ".5".The above is the detailed content of How Can I Control Decimal Places When Displaying Currency Values in C#?. For more information, please follow other related articles on the PHP Chinese website!