Skip to content

Commit 9e6e50a

Browse files
committed
Fix zero padding for displayed variable values.
1 parent 4f7a54c commit 9e6e50a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/model/styling.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,10 @@ export function variableValue(style: DisplayStyle, variable: Variable, value: bi
8383
}
8484
let stringValue;
8585
switch (radix) {
86-
case 2: stringValue = value.toString(2) .padStart(variable.width / 1, '0');
87-
case 8: stringValue = value.toString(8) .padStart(variable.width / 3, '0');
88-
case 10: stringValue = value.toString(10);
89-
case 16: stringValue = value.toString(16).padStart(variable.width / 4, '0');
86+
case 2: stringValue = value.toString(2) .padStart(variable.width / 1, '0'); break;
87+
case 8: stringValue = value.toString(8) .padStart(variable.width / 3, '0'); break;
88+
case 10: stringValue = value.toString(10); break;
89+
case 16: stringValue = value.toString(16).padStart(variable.width / 4, '0'); break;
9090
}
9191
switch (style) {
9292
case DisplayStyle.Python:

0 commit comments

Comments
 (0)