[Vtigercrm-developers] decimal field format

Rubén A. Estrada Orozco rulotec1 at gmail.com
Tue Feb 25 16:13:21 GMT 2025


Thank you very much!

In the case of currency, I think, as stated before, that the format should
ONLY apply to detail view and not edit view to avoid losing decimals. Would
you be open to accept a MR implementing that behavior?

On Tue, Feb 25, 2025 at 3:15 AM Prasad <prasad at vtiger.com> wrote:

> Reverted fix in commit
> <https://code.vtiger.com/vtiger/vtigercrm/-/commit/0b104a642d1966a6d0995cdf53507fd9c3d5031c>
>
> On Mon, Feb 24, 2025 at 10:23 PM Rubén A. Estrada Orozco <
> rulotec1 at gmail.com> wrote:
>
>> Dear Prasad, if you can't implement the suggested approach, do you think
>> we could at least revert that change?
>>
>> On Tue, Feb 18, 2025 at 10:34 AM Rubén A. Estrada Orozco <
>> rulotec1 at gmail.com> wrote:
>>
>>> 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/
>>>
>>> _______________________________________________
>> http://www.vtiger.com/
>
> _______________________________________________
> http://www.vtiger.com/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.vtigercrm.com/pipermail/vtigercrm-developers/attachments/20250225/9229ce43/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/20250225/9229ce43/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/20250225/9229ce43/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/20250225/9229ce43/attachment-0005.png>


More information about the vtigercrm-developers mailing list