|
|
@ -18,12 +18,11 @@ export class ValueComponent implements OnChanges { |
|
|
|
@Input() colorizeSign = false; |
|
|
|
@Input() currency = ''; |
|
|
|
@Input() isCurrency = false; |
|
|
|
@Input() isInteger = false; |
|
|
|
@Input() isPercent = false; |
|
|
|
@Input() label = ''; |
|
|
|
@Input() locale = ''; |
|
|
|
@Input() position = ''; |
|
|
|
@Input() precision = 0; |
|
|
|
@Input() precision: number | undefined; |
|
|
|
@Input() size = ''; |
|
|
|
@Input() value: number | string = ''; |
|
|
|
|
|
|
@ -83,20 +82,15 @@ export class ValueComponent implements OnChanges { |
|
|
|
minimumFractionDigits: 2 |
|
|
|
}); |
|
|
|
} catch {} |
|
|
|
} else if (this.isInteger) { |
|
|
|
} else if (this.precision || this.precision === 0) { |
|
|
|
try { |
|
|
|
this.formattedValue = this.value?.toLocaleString(this.locale, { |
|
|
|
maximumFractionDigits: 0, |
|
|
|
minimumFractionDigits: 0 |
|
|
|
}); |
|
|
|
} catch {} |
|
|
|
} else if (this.precision) { |
|
|
|
this.formattedValue = this.value?.toLocaleString(this.locale, { |
|
|
|
maximumFractionDigits: this.precision, |
|
|
|
minimumFractionDigits: this.precision |
|
|
|
}); |
|
|
|
} catch {} |
|
|
|
} else { |
|
|
|
this.formattedValue = this.value.toString(); |
|
|
|
this.formattedValue = this.value?.toString(); |
|
|
|
} |
|
|
|
} else { |
|
|
|
try { |
|
|
|