Skip to content

Commit

Permalink
Fix formatting of int64 provided as numbers in Compound vis
Browse files Browse the repository at this point in the history
  • Loading branch information
axelboc committed Feb 3, 2025
1 parent 808b099 commit d507cfe
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions packages/app/src/vis-packs/core/matrix/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,16 @@ export function createNumericFormatter(
export function createBigIntFormatter(
notation: Notation,
): (val: ScalarValue<NumericType>) => string {
const formatter = createNumericFormatter(notation);

switch (notation) {
case Notation.Scientific: {
const formatter = createNumericFormatter(notation);
case Notation.Scientific:
return (val) => formatter(Number(val));
}

default:
return (val) => val.toString();
return (val) => {
return typeof val === 'bigint' ? val.toString() : formatter(val);
};
}
}

Expand Down

0 comments on commit d507cfe

Please sign in to comment.