feat: add precisionIs5

This commit is contained in:
Fine 2023-02-21 21:28:59 +08:00
parent 68b8540577
commit d98110de85
3 changed files with 5 additions and 0 deletions

View File

@ -39,6 +39,7 @@ export enum Calculations {
ApdexAvg = "apdexAvg",
SecondToDay = "secondToDay",
NanosecondToMillisecond = "nanosecondToMillisecond",
PrecisionIs5 = "precisionIs5",
}
export enum sizeEnum {
XS = "XS",

View File

@ -407,6 +407,9 @@ export function aggregation(val: number, config: { calculation?: string }): numb
case Calculations.Precision:
data = data.toFixed(2);
break;
case Calculations.PrecisionIs5:
data = data.toFixed(5);
break;
case Calculations.MsToS:
data = (val / 1000).toFixed(2);
break;

View File

@ -310,6 +310,7 @@ export const CalculationOpts = [
},
{ label: "Seconds to YYYY-MM-DD HH:mm:ss", value: "convertSeconds" },
{ label: "Precision is 2", value: "precision" },
{ label: "Precision is 5", value: "precisionIs5" },
{ label: "Milliseconds to seconds", value: "msTos" },
{ label: "Seconds to days", value: "secondToDay" },
{ label: "Nanoseconds to milliseconds", value: "nanosecondToMillisecond" },