Skip to content

Commit 570bd6b

Browse files
Hotfix for rounding (bcgov#1766)
1 parent 9f9748d commit 570bd6b

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

components/src/components/SimpleNumber/Component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ export default class Component extends (ParentComponent as any) {
5353
const decimalPlaces = this.component.decimalLimit || 2;
5454
const multiplier = Math.pow(10, decimalPlaces);
5555
let numValue = Number.parseFloat(value);
56-
if (!Number.isNaN(numValue)) {
57-
switch (this.component.rounding.method) {
56+
if (!Number.isNaN(numValue) && this.component.rounding) {
57+
switch (this.component?.rounding?.method) {
5858
case 'floor':
5959
numValue = Math.floor(numValue * multiplier) / multiplier;
6060
break;

0 commit comments

Comments
 (0)