@hmcts/ccd-case-ui-toolkit 7.3.47 → 7.3.48-pofcc-105
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -19809,12 +19809,18 @@ class MoneyGbpInputComponent {
|
|
|
19809
19809
|
writeValue(obj) {
|
|
19810
19810
|
if (obj) {
|
|
19811
19811
|
this.rawValue = obj;
|
|
19812
|
-
|
|
19813
|
-
|
|
19814
|
-
|
|
19815
|
-
|
|
19812
|
+
// If already contains decimal, use it directly
|
|
19813
|
+
if (obj.includes('.')) {
|
|
19814
|
+
this.displayValue = obj;
|
|
19815
|
+
}
|
|
19816
|
+
else {
|
|
19817
|
+
const integerPart = obj.slice(0, -2) || '0';
|
|
19818
|
+
let decimalPart = obj.slice(-2);
|
|
19819
|
+
while (2 > decimalPart.length) {
|
|
19820
|
+
decimalPart += '0';
|
|
19821
|
+
}
|
|
19822
|
+
this.displayValue = [integerPart, decimalPart].join('.');
|
|
19816
19823
|
}
|
|
19817
|
-
this.displayValue = [integerPart, decimalPart].join('.');
|
|
19818
19824
|
}
|
|
19819
19825
|
}
|
|
19820
19826
|
registerOnChange(fn) {
|