Hello,
I've decimal value 18.8. Values that are stored in this variable can be of any kind. For example it can be 1.0000000 or 1.00004000 or 5.00000008. I would like to write a method so that i can pass decimal to it and get rounded up string. This wouldn't be a problem if i would know decimal places i would like to get. But what i would like to get is:
When it's 1.0000000 it should return 1.
If it's 1.00004000 it should return 1.00004.
When it's 5.00000008 it should return 5.00000008.
So basically it should find all 0 that are behind last digit diffrent then 0 and cut it off.
How should i aproach it? What's the best method? I'm getting this value from SQL and put it in decimal variable but then i would like to display it and having 5.0000000 when it could be displayed as 5 is a bit overkill for me.
Hope I could get some nice suggestions.
With regards,
MadBoy