mirror of
https://github.com/SimpleMobileTools/Simple-Calculator.git
synced 2025-06-05 21:49:13 +02:00
allow writing zeroes as decimal values
This commit is contained in:
@@ -76,6 +76,11 @@ public class CalculatorImpl {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private String formatString(String str) {
|
private String formatString(String str) {
|
||||||
|
// if the number contains a decimal, do not try removing the leading zero anymore, nor add group separator
|
||||||
|
// it would prevent writing values like 1.02
|
||||||
|
if (str.contains("."))
|
||||||
|
return str;
|
||||||
|
|
||||||
final double doubleValue = Formatter.stringToDouble(str);
|
final double doubleValue = Formatter.stringToDouble(str);
|
||||||
return Formatter.doubleToString(doubleValue);
|
return Formatter.doubleToString(doubleValue);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user