Support » Plugin: Pods - Custom Content Types and Fields » Numeric field softformat truncates leading instead of trailing

  • Resolved cip247

    (@cip247)


    Hello pods Community,

    I am relativly new to pods but I already love the flexibility it gives me. Thanks for the great work.
    Now I encountered a strange behavior with pods and the Plain number field.

    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 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).

    Has anybody encountered the same thing, does anbody have an idea how to fix this?

    Thanks a lot
    Marc

    My setup: worpress 5.0.3, pods 2.7.12

Viewing 3 replies - 1 through 3 (of 3 total)
  • It seems softformat truncates trailing and leading zeros ( and with that the divider in my case “,”). I think that is not the intended behavior.

    Nobody else is experiencing this behavior with numeric fields? I would love to use softformat, the way it is described in the tooltip. Removing trailing zeros.
    Otherwise my tables get to cluttered.

    Hope to here from somebody.
    Marc

    Plugin Author Jim True

    (@jimtrue)

    Can you create this one as a bug report? This sounds like this is definitely a bug:

    https://github.com/pods-framework/pods/issues/new/choose

    We don’t tend to work bug reports within WordPress forums, because we can track and get the fix applied more quickly and work with you to make sure it is working as intended through GitHub.

    Hi Jim,

    thanks for the reply. I just submitted a bug report on GitHub.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Numeric field softformat truncates leading instead of trailing’ is closed to new replies.