Skip to content

Commit d507cfe

Browse files
committed
Fix formatting of int64 provided as numbers in Compound vis
1 parent 808b099 commit d507cfe

File tree

1 file changed

+7
-4
lines changed
  • packages/app/src/vis-packs/core/matrix

1 file changed

+7
-4
lines changed

packages/app/src/vis-packs/core/matrix/utils.ts

+7-4
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,16 @@ export function createNumericFormatter(
3838
export function createBigIntFormatter(
3939
notation: Notation,
4040
): (val: ScalarValue<NumericType>) => string {
41+
const formatter = createNumericFormatter(notation);
42+
4143
switch (notation) {
42-
case Notation.Scientific: {
43-
const formatter = createNumericFormatter(notation);
44+
case Notation.Scientific:
4445
return (val) => formatter(Number(val));
45-
}
46+
4647
default:
47-
return (val) => val.toString();
48+
return (val) => {
49+
return typeof val === 'bigint' ? val.toString() : formatter(val);
50+
};
4851
}
4952
}
5053

0 commit comments

Comments
 (0)