Does anyone know how to calculate percentages? The client wants ther percentage to always be displayed as - for example - 0.100 instead of 0.1, 0.110 instead of 0.11, or if there's three digits, 0.111, et cetera. The value always has to have three trailing digits.
I'm not sure to go about doing this because the value is taken from the database and it always gets rid of any trailing zeros. I also donít want to do anything that could mess up the actual value that's written to the database. I'm guessing I need to somehow format the value as it's being taken from the DB, but how?
Do a search on google for (VB.NET/C#/J#/Your language here) pad number.
Math::Round allows rounding to a certain decimal, so you could go
And you would get a percentage with three decimals.
Math::Round((value / total), 3);
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)