Remove leading zero and delimiter char for BigDecimal
-
30-10-2019 - |
문제
Our application can get following numbers:
0.1
0.02
0.003
etc.
These values treated by our code as BigDecimal
,as far we operate with money.
There is form on web UI, where user should view these floating parts of prices, transformed to following ones:
1
02
003
The question is,how to trim leading zero
and delimiter character
in input prices. Perhaps BigDecimal
class has standard method something like trimLeadingZeroes(),but can't find any.
UPDATE: trim just leading zero and delimiter symbol
For instance:
1 is 0.1
27 is 0.27
올바른 솔루션이 없습니다
제휴하지 않습니다 StackOverflow