How to strip decimals from a number column

This topic is: not resolved

This topic contains 2 replies, has 2 voices, and was last updated by  codebloo 1 year ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #167763

    codebloo
    Participant
    Post count: 11

    I’ve looked through the plain_numbers package, other threads, display helpers docs and I just don’t get it.

    I would really appreciate some specific help to get my column "order" to display as integers without decimals

    My template calls in the field like this

    $order = $question->get_field(‘order’);

    and displays it like this

    <?php echo $order; ?>

    What do I need to put in a helper > Add helper > display box to strip the decimals

    AND THEN

    what do I need to do on the template page to run it through that filter?

    Thank and sorry for such a rudimentary question.

    #167764

    sc0ttkclark
    Keymaster
    Post count: 809

    Here’s very simple example, no helper needed (or you can replace $order with $value and make it a display helper to do the exact same thing:

    #167765

    codebloo
    Participant
    Post count: 11

    THANK YOU! :D

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.

Wordpress Cloud Hosting