update cartion editor for package

This commit is contained in:
tzw
2024-02-06 17:45:36 +06:30
parent 3767ba76dc
commit 3a91b49a1a
10 changed files with 563 additions and 109 deletions

View File

@@ -395,3 +395,12 @@ bool hasUnicode(String text) {
text.codeUnits.where((ch) => ch > maxBits).toList();
return unicodeSymbols.length > 0;
}
String removeTrailingZeros(double number) {
String result = number.toString();
result = result.indexOf('.') > 0
? result.replaceAll(RegExp(r"([.]*0)(?!.*\d)"), "")
: result;
return result;
}