Your address will show here +12 34 56 78

Home Forums WP ESTATE – Real Estate WordPress Theme FORUM Change Number Format for Property Size and Property Lot Size

This topic contains 1 reply, has 2 voices, and was last updated by  Paketo 2 years, 5 months ago.

  • Author
    Posts
  • #74692

    Anna
    Keymaster

    Hi Agus

    You need to change the number format in PHP. By default it doesn’t support decimals. Only full numbers.

    First look for the property field in the theme files.

    Property Size:

    You have to look for $property[‘property_size’] = number_format($property[‘property_size’])

    in the entire theme and change the price format to French format (this is the link to the PHP documentation for price format) http://php.net/manual/en/function.number-format.php

    Ex:

    $property[‘property_size’] = number_format($property[‘property_size, 2, ‘,’, ‘ ”])

    Look for also something like this

    $property[‘property_size’] = intval ( get_post_meta($post->ID, ‘property_size’, true) );
    $property[‘property_lot_size’] = intval( get_post_meta($post->ID, ‘property_lot_size’, true) );

    Where you see

    intval

    Replace intval with floatval
    Floatval adds decimals.

    Property Lot size, the same, but the field name is different

    $property[‘property_lot_size’] = intval( get_post_meta($post->ID, ‘property_lot_size’, true));
    if ($property[‘property_lot_size’] != ”) {
    $property[‘property_lot_size’] = number_format($property[‘property_lot_size’]) .’ ‘.$measure_sys.’2‘;
    }

     

    All this must be done by manually changing code (don’t copy paste as formatting will be wrong).

    Hope it helps.

    Thanks
    Anna

  • #105911

    Paketo
    Participant

    I have created a custom field under the Theme Options to include the number of stories a property is. I have a property that is 1.5 stories. Where do I edit intval to floatval for this custom field?

    Thanks.

You must be logged in to reply to this topic.