Commit 060a54cd6dbb1234445992f0ea40daf20471ab1a

Authored by Vladyslav_Prykhodko
1 parent bc182caa

Check if subscription or formatValue not change view str value to number

... ... @@ -624,7 +624,7 @@ export class EntityDataSubscription {
624 624 }
625 625
626 626 private convertValue(val: string): any {
627   - if (val && this.isNumeric(val)) {
  627 + if (val && this.isNumeric(val) && Number(val).toString() === val) {
628 628 return Number(val);
629 629 } else {
630 630 return val;
... ...
... ... @@ -115,8 +115,7 @@ export function isEmpty(obj: any): boolean {
115 115 }
116 116
117 117 export function formatValue(value: any, dec?: number, units?: string, showZeroDecimals?: boolean): string | undefined {
118   - if (isDefined(value) &&
119   - value !== null && isNumeric(value)) {
  118 + if (isDefinedAndNotNull(value) && isNumeric(value) && (isDefined(dec) || isDefined(units) || Number(value).toString() === value)) {
120 119 let formatted: string | number = Number(value);
121 120 if (isDefined(dec)) {
122 121 formatted = formatted.toFixed(dec);
... ...