Last post Jun 03, 2019 12:12 PM by AddWeb Solution
Jun 03, 2019 11:58 AM|bluMarmalade|LINK
I have a datatype of float where sometimes after division there are too many decimals.
I don't want to round up to nearest integer, like with the method float)Math.Round().
I need to show up to two decimals like 12.35
How can i display this correctly?
Jun 03, 2019 12:07 PM|PatriceSc|LINK
It is not only to round to the nearest integer. You don't have seen you can call this with other parameters as shown at https://docs.microsoft.com/en-us/dotnet/api/system.math.round?view=netframework-4.8#examples ?
Jun 03, 2019 12:12 PM|AddWeb Solution|LINK
To format the number you may use .ToString(formatString) like so:
or Use string format function
I hope this will help you