Created destructive removeTrailingZeros() method on ZString.
This commit is contained in:
1 parent
faa794cf6b
commit
bf4ff3fdac
3 files changed
+20
-1
No files matched your search
+10
-1
@@ -544,7 +544,16 @@ namespace coreutils {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
ZString ZString::removeTrailingZeros() {
|
||||
if(length > 2) {
|
||||
while((*(data + length - 1)) == '0')
|
||||
--length;
|
||||
if(*(data + length - 1) == '.')
|
||||
--length;
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
void ZString::nextChar() {
|
||||
if(!eod())
|
||||
++cursor;
|
||||
|
||||
Reference in new issue
Block a user