|
|
@ -30,6 +30,13 @@ onMounted(() => { |
|
|
|
vModel.value.meta.precision = precisionFormats[0] |
|
|
|
vModel.value.meta.precision = precisionFormats[0] |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// update datatype precision when precision is less than the new value |
|
|
|
|
|
|
|
// avoid downgrading precision if the new value is less than the current precision |
|
|
|
|
|
|
|
// to avoid fractional part data loss(eg. 1.2345 -> 1.23) |
|
|
|
|
|
|
|
const onPrecisionChange = (value: number) => { |
|
|
|
|
|
|
|
vModel.value.dtxs = Math.max(value, vModel.value.dtxs) |
|
|
|
|
|
|
|
} |
|
|
|
</script> |
|
|
|
</script> |
|
|
|
|
|
|
|
|
|
|
|
<template> |
|
|
|
<template> |
|
|
@ -38,6 +45,7 @@ onMounted(() => { |
|
|
|
v-if="vModel.meta?.precision" |
|
|
|
v-if="vModel.meta?.precision" |
|
|
|
v-model:value="vModel.meta.precision" |
|
|
|
v-model:value="vModel.meta.precision" |
|
|
|
dropdown-class-name="nc-dropdown-decimal-format" |
|
|
|
dropdown-class-name="nc-dropdown-decimal-format" |
|
|
|
|
|
|
|
@change="onPrecisionChange" |
|
|
|
> |
|
|
|
> |
|
|
|
<a-select-option v-for="(format, i) of precisionFormats" :key="i" :value="format"> |
|
|
|
<a-select-option v-for="(format, i) of precisionFormats" :key="i" :value="format"> |
|
|
|
<div class="flex gap-2 w-full justify-between items-center"> |
|
|
|
<div class="flex gap-2 w-full justify-between items-center"> |
|
|
|