Skip to content
This repository has been archived by the owner on Nov 25, 2024. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
elsiosanchez authored Oct 21, 2024
1 parent 7f5858e commit 3b588ab
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 6 additions & 3 deletions src/components/ADempiere/FieldDefinition/FieldNumber.vue
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,12 @@ import {
NUMBER
} from '@/utils/ADempiere/references.js'
import { CURRENCY } from '@/utils/ADempiere/constants/systemColumns'
import { NUMBER_PRECISION } from '@/utils/ADempiere/formatValue/numberFormat.js'

// Utils and Helper Methods
import { isDecimalField } from '@/utils/ADempiere/references.js'
import { formatNumber } from '@/utils/ADempiere/formatValue/numberFormat.js'
import { getTypeOfValue, isEmptyValue } from '@/utils/ADempiere/valueUtils.js'
import { standardPrecisionContext } from '@/utils/ADempiere/formatValue/numberFormat.js'

export default {
name: 'FieldNumber',
Expand Down Expand Up @@ -127,7 +127,10 @@ export default {
return this.metadata.precision
}
if (this.metadata.display_type === NUMBER.id) {
return NUMBER_PRECISION
return standardPrecisionContext({
parentUuid: this.metadata.parentUuid,
containerUuid: this.metadata.containerUuid
})
}
if (isDecimalField(this.metadata.display_type)) {
return store.getters.getStandardPrecision
Expand Down Expand Up @@ -160,7 +163,7 @@ export default {
value: this.value,
displayType: this.metadata.display_type,
currency: this.currencyCode,
precision: this.metadata.precision
precision: this.precision
})
}
},
Expand Down
2 changes: 1 addition & 1 deletion src/utils/ADempiere/formatValue/numberFormat.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ export function formatNumber({
break

case NUMBER.id:
formattedNumber = formatQuantity({ value, precision: NUMBER_PRECISION })
formattedNumber = formatQuantity({ value, precision: !isEmptyValue(precision) ? precision : NUMBER_PRECISION })
break
// Quantity
case QUANTITY.id:
Expand Down

0 comments on commit 3b588ab

Please sign in to comment.