Fix missing leading zeros in %0d, bug367

This commit is contained in:
Wilson Snyder
2011-07-14 07:39:11 -04:00
parent ae4a261463
commit 698aaffb0b
6 changed files with 37 additions and 10 deletions
+5 -1
View File
@@ -472,7 +472,11 @@ string V3Number::displayed(const string& vformat) const {
str = cvtToStr(toUQuad());
}
int intfmtsize = atoi(fmtsize.c_str());
while ((int)(str.length()) < intfmtsize) str = " "+str;
bool zeropad = fmtsize.length()>0 && fmtsize[0]=='0';
while ((int)(str.length()) < intfmtsize) {
if (zeropad) str = "0"+str;
else str = " "+str;
}
return str;
}
default: