Last active
November 7, 2019 09:50
-
-
Save esabook/1042637c9a2ea84c0247cad4adfaa385 to your computer and use it in GitHub Desktop.
remove leading zero for decimal result
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// remove leading zero from form input, | |
// 0000003232 change to 3232 | |
// 0000.002 change to 0.002 | |
// 00,030 change to 0,030 | |
String formatedSellingValue = roundedSellingValue | |
.replaceFirst("^((?![(\\.)|(\\,)]))+(?!$)", ""); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment