mirror of
https://github.com/verilator/verilator.git
synced 2026-10-06 01:54:01 +02:00
Fix missing leading zeros in %0d, bug367
This commit is contained in:
+5
-1
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user