vmui: fixed yaxis labels (#2448)

This commit is contained in:
Dmytro Kozlov 2022-04-12 15:12:06 +03:00 committed by GitHub
parent 7f83dc06c4
commit c4d2cd8336
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -29,10 +29,7 @@ export const defaultOptions = {
};
export const formatTicks = (u: uPlot, ticks: number[], unit = ""): string[] => {
return ticks.map(v => {
const n = Math.abs(v);
return `${n > 1e-3 && n < 1e4 ? v.toString() : v.toExponential(1)} ${unit}`;
});
return ticks.map(v => `${v.toLocaleString()} ${unit}`);
};
interface AxisExtend extends Axis {