[Vtigercrm-developers] decimal field format

Rubén A. Estrada Orozco rulotec1 at gmail.com
Tue Feb 18 16:34:27 GMT 2025


Based on the comments in this thread, my suggestion would be:

1. Separate currency format from numeric format. This would imply having a
field in the user's profile where you can specify the number of decimals
for numeric non-currency fields.
2. The established format should only affect how numbers are displayed.
When editing, all available decimals should be used. Otherwise, this would
have the undesired effect of losing decimals whenever someone with a fewer
decimals setting edits a record created/edited by someone with a higher
decimals setting, EVEN if that field was left untouched.

For me, that is the most reasonable/expected behavior.


On Tue, Feb 18, 2025 at 4:41 AM Prasad <prasad at vtiger.com> wrote:

> Is there a suggested fix for quick review (or) few more test-cases to
> assess?
>
> On Sun, Feb 16, 2025 at 1:25 AM Rubén A. Estrada Orozco <
> rulotec1 at gmail.com> wrote:
>
>> Prasad, can you please look into this?
>>
>> On Fri, Feb 14, 2025 at 9:01 PM Alan Lord <alanslists at gmail.com> wrote:
>>
>>> I'm sure there is a ticket on code.vtiger.com for this or something
>>> very similar but I couldn't find it. It's a shame that the commit didn't
>>> reference a ticket.
>>>
>>> I agree though, currency fields should be treated completely separately
>>> from normal decimal fields.
>>>
>>> Al
>>>
>>> On 14/02/2025 05:44, Rubén A. Estrada Orozco wrote:
>>>
>>> Hi everyone,
>>>
>>> I see this change was introduced about 9 months ago:
>>> https://code.vtiger.com/vtiger/vtigercrm/-/merge_requests/1185/diffs
>>>
>>> [image: image.png]
>>>
>>> This change has important/serious implications for the behavior of
>>> Vtiger.
>>>
>>> It formats all decimal fields according to the "Number of Currency
>>> Decimals" parameter in the user's preferences. Such preferences can vary
>>> from user to user.
>>>
>>> [image: image.png]
>>>
>>> If you create a field such as this one:
>>>
>>> [image: image.png]
>>>
>>> You expect it to have 4 decimals. You also expect that the *currency* number
>>> format would not impact such other fields. But guess what? it does!!!
>>>
>>> There is a big problem with this. If a user with 4 decimals format sets
>>> a field value of a record to say 0.1234, and then a user with 2 decimals
>>> format edits the same record without touching said field, then its value
>>> will change to 0.12. Not the expected behavior, right?
>>>
>>> Moreover, if you come from a Vtiger version prior to 8.2 and upgrade,
>>> then this will potentially mess up your data little by little, removing
>>> decimals from such fields. Because, the default number of decimals for
>>> currency fields is 2, so most probably, you'll be losing decimals.
>>>
>>> This was not carefully thought through. Vtiger team, please consider
>>> reverting that change.
>>>
>>>
>>>
>>> Saludos
>>>
>>> Rubén
>>>
>>> _______________________________________________http://www.vtiger.com/
>>>
>>>
>>> _______________________________________________
>>> http://www.vtiger.com/
>>
>> _______________________________________________
>> http://www.vtiger.com/
>
> _______________________________________________
> http://www.vtiger.com/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.vtigercrm.com/pipermail/vtigercrm-developers/attachments/20250218/2bb20060/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 81577 bytes
Desc: not available
URL: <http://lists.vtigercrm.com/pipermail/vtigercrm-developers/attachments/20250218/2bb20060/attachment-0003.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 68470 bytes
Desc: not available
URL: <http://lists.vtigercrm.com/pipermail/vtigercrm-developers/attachments/20250218/2bb20060/attachment-0004.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 50581 bytes
Desc: not available
URL: <http://lists.vtigercrm.com/pipermail/vtigercrm-developers/attachments/20250218/2bb20060/attachment-0005.png>


More information about the vtigercrm-developers mailing list