Skip to content

Commit 21649e0

Browse files
committed
fix: improve float input value handling by formatting modelValue
1 parent 69a25cb commit 21649e0

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

adminforth/spa/src/components/ColumnValueInput.vue

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,8 @@
9999
:fullWidth="true"
100100
:prefix="column.inputPrefix"
101101
:suffix="column.inputSuffix"
102-
:modelValue="value !== null && value !== undefined ? parseFloat(value) : ''"
102+
:modelValue="value?.toString().replace(/(\.[0-9]*[1-9])0+$|\.0+$/, '$1')"
103103
@update:modelValue="$emit('update:modelValue', $event)"
104-
@blur="$emit('update:modelValue', value ? parseFloat(value).toString() : '')"
105104
/>
106105
<Input
107106
v-else-if="(type || column.type) === 'float'"

0 commit comments

Comments
 (0)