Format number fields on output

Support General Format number fields on output

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #37191
    John RoodJohn Rood
    Participant

    Is there an easy way to format all number fields on output to include serial commas? We are currently storing numbers as "9999", which is how we want them in the database, but once we render them on the frontend, we want it to render as 9,999.

    We don't want to change the database value, we just want to format it on output.

    Thanks,
    John

    #37210
    Long NguyenLong Nguyen
    Moderator

    Hi John,

    Please follow the PHP documentation to know how to format PHP value https://www.php.net/manual/en/function.number-format.php

    #37214
    John RoodJohn Rood
    Participant

    That works really well for displaying fields with code, I was just wondering if there was some kind of filter that handles when the value is output through Oxygen Builder's Dynamic Data so that I can modify the output with PHP.

    Basically I'm just wondering if there's a Meta Box equivalent to ACF's format_value filter.

    Since (when using the builder) I only have the option to return the field itself, this would be a clean way to handle those fields. I'm just not sure if that's something MB does.

    Thanks for all your help,
    John

    #37224
    Long NguyenLong Nguyen
    Moderator

    Hi John,

    Meta Box is also supported filter hooks to modify the field value before outputting but in the Oxygen builder, it is based on whether the builder supports the filter or not.
    https://docs.metabox.io/filters/rwmb-meta/

    I recommend contacting Oxygen support to ask for help with this case.

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.