primefaces / primeng

The Most Complete Angular UI Component Library
https://primeng.org
Other
10.46k stars 4.6k forks source link

[p-inputNumber]How to get the original value before maxFractionDigits #16237

Open ttnnphuoc opened 2 months ago

ttnnphuoc commented 2 months ago

I want to get the original value for we do the action maxFractionDigits in [p-inputNumber] Example: original value: 89.931334923; maxFractionDigits=2 => new value is 89.93. So I want to get the original value (89.931334923) to calculation some thing. Can you fix this or add a new property to get original value before splice with maxFractionDigits to control this?

ibrahimkelly commented 2 months ago

I want to get the original value for we do the action maxFractionDigits in [p-inputNumber] Example: original value: 89.931334923; maxFractionDigits=2 => new value is 89.93. So I want to get the original value (89.931334923) to calculation some thing. Can you fix this or add a new property to get original value before splice with maxFractionDigits to control this?

It's also possible to handle it in typescript side, for example if it's resulted by a division you have to set originalValue = x/y. Also the minFraction is only in visual side.