Remove non significant zeros in a decimal number with rounding

I am new to coding. I have created a simple calculator to divide two numbers and display the result with 5 decimal digits rounding. When I divide 1 by 1000 (as an example), it is showing the answer as 0.00100. My question is how to remove the two zeros on the right-hand side of the answer so that I can get the value as 0.001. I need to do lot of this type of calculations in an app that can do conversions between different units. Is there a simple solution available? Your help will be highly appreciated.


Check this out...

Try this

decimal22

grafik

Another method:

image

There is probably a better way to do this.....

Another approach maybe is ... :thinking:

Thank you so much for your time in helping. Really appreciate. Let me try this out.

1 Like

Really appreciate your support. Let me look into this option. I checked once but i was having some issues when the rounding is 15. But let me explore more in this direction. Thank you

Thank you. I was also trying to implement it in a similar way using list. But thought of checking some simpler way with any direct options. The list option was working for most of the phones but throwing "Select list item: List index too large" error. If direct ways are not working, i will also go to this option. Thank you so much for your kind support.

1 Like