Support » Plugin: Insert PHP » Echoing dollar values, $25.00 turns into .00

  • Resolved Smaandar

    (@smaandar)


    If I do, for instance,

    [insert_php]
    
         echo "$25.00";
    
    [/insert_php]

    It displays on the page as:

    .00

    If I do,

    [insert_php]
    
         echo "25.00";
    
    [/insert_php]

    It displays as:

    25.00

    Any ideas as to why this happens, and how to resolve it? I’m not sure if word press is filtering this, and ideas?

    https://wordpress.org/plugins/insert-php/

Viewing 2 replies - 1 through 2 (of 2 total)
  • The only fix I’ve found is to make a custom page template for the page in question in Word Press, and put my php code into there.

    Plugin Author WillBontrager

    (@willbontrager)

    Smaandar, try
    echo "\$25.00";
    or
    echo '$25.00';

    The $ symbol within double quotes means what follows should be treated as a variable. Escaping it, or putting it in single quotes, bypasses that.

    Will

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Echoing dollar values, $25.00 turns into .00’ is closed to new replies.