Skip to content

Commit

Permalink
feat: better rendering for initial state (#2745)
Browse files Browse the repository at this point in the history
Co-authored-by: Dean Tribble <tribble@agoric.com>
  • Loading branch information
dtribble and dtribble authored Mar 30, 2021
1 parent 1868082 commit f862428
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/ui-components/src/display/natValue/stringifyNat.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,13 @@ const CONVENTIONAL_DECIMAL_PLACES = 2;
* @returns {string}
*/
export const stringifyNat = (
natValue = 0n,
natValue = null,
decimalPlaces = 0,
placesToShow = CONVENTIONAL_DECIMAL_PLACES,
) => {
if (natValue === null) {
return '';
}
assert.typeof(natValue, 'bigint');
const str = `${natValue}`.padStart(decimalPlaces, '0');
const leftOfDecimalStr = str.substring(0, str.length - decimalPlaces) || '0';
Expand Down

0 comments on commit f862428

Please sign in to comment.