add calculation

This commit is contained in:
Qiuxia Fan 2022-04-01 21:06:01 +08:00
parent b854b86ab4
commit b817ed5825
3 changed files with 5 additions and 0 deletions

View File

@ -32,6 +32,7 @@ export enum Calculations {
Precision = "precision",
ConvertSeconds = "convertSeconds",
ConvertMilliseconds = "convertMilliseconds",
MsTos = "msTos",
}
export enum sizeEnum {
XS = "XS",

View File

@ -351,6 +351,9 @@ export function aggregation(val: number, config: any): number | string {
case Calculations.Precision:
data = data.toFixed(2);
break;
case Calculations.MsTos:
data = val / 1000;
break;
default:
data;
break;

View File

@ -272,4 +272,5 @@ export const CalculationOpts = [
},
{ label: "Convert seconds to YYYY-MM-DD HH:mm:ss", value: "convertSeconds" },
{ label: "Precision is 2", value: "precision" },
{ label: "Milliseconds to seconds", value: "msTos" },
];