Closed cip247 closed 5 years ago
Maybe this is also related to my reported problem => #5215
Note that everything saves fine in the DB so this issue is in the formatting on load.
The immediate fix could present an issue for back-compat. The saved data will always have leading zeroes so if you previously were seeing .025
displayed, it'll then be 0.025
as there is no way to determine if the leading zero was manually entered or a side-effect of the save.
I think the best fix might be separate options for trimming leading and trailing zeroes.
Moving to 2.7.14
@cip247 Please test #5439 and let us know if this fixes your issue! @JLNNN It seems you have a different issue which I will address separately.
Describe the bug I have a custom post type where I need to use numbers with 3 to 4 decimals. So I have set up a number field (decimals 4, softformat yes). The page is in german so I am using , as a divider. The tooltip for softformat reads „ remove trailing decimals (0)“ which is exacly the functionality that I need. So in my understanding it should be 0,02 instead of 0,0200 when I enter 0,02. But if softformat is enabled it seems that it is truncating the leading zeros AND the trailing zeros instead of the supposed trailing. So if I enter 0,02 and save only 02 remains. This gets then displayed in frontend as 2. When disabling softformat it gets correctly displayed but it adds the missing zeros, so 0,03 becomes 0,0300. It would be great if it wold then stay 0,03 (which is what I expected from softformat).
To Reproduce Steps to reproduce the behavior: create new pods Custom Typ add field Plain Number, decimals 4, softformat yes
Expected behavior If entered 0,02 -> 0,02 If entered 0,023 -> 0,023 If entered 0,0234 -> 0,0234
Screenshots
I have this checkbox checked since I need the removal of TRAILING zeros
without soft format if adds missing zeros so if I enter 0,02 it becomes 0,0200
Pods Version
2.7.12
WordPress Environment
Pods Package Export (helpful!)
Additional context I really like pods and the flexibility it gives me! Keep on the great work ! Thanks from Germany.
Possible Workaround Setting the field as text displays it correctly.