[Vtigercrm-developers] vtiger 7.4.0 UIType 7 truncating trailing zeros
Alan Lord
alanslists at gmail.com
Tue Apr 12 13:54:01 GMT 2022
On 12/04/2022 14:34, Alan Lord wrote:
> If I set my user to NOT truncate trailing zeros, enter something like
> 1.30, or 5.00 into a UItype 7 field. In the database column the data is
> stored *with* the trailing zeros. Yet on screen, after a save and a
> reload the trailing zeros are removed from view.
>
> Has anyone else seen this? Got a fix?
Here we go.
The Vtiger_Double_UIType getDisplayValue($value) method ultimately calls
this gem of a bit of code:
https://code.vtiger.com/vtiger/vtigercrm/blob/master/vtlib/Vtiger/Functions.php#L511
Which checks to see if there is a decimal point (a "." which is not used
by lots of countries as the decimal marker - many use a comma ","). If
there is a ".", it strips any trailing zeros.
Then it removes any trailing decimal points (but again only a ".") -
completely ignoring the user's own preferences.
Sheesh.
Al
More information about the vtigercrm-developers
mailing list