Problem:
How to display custom numeric field divided by 100.
Solution:
To divide custom field value by 100, you need to add custom shortcode to your current theme's functions.php file:
add_shortcode('format_length', 'func_format_length'); function func_format_length( $atts,$content ) { $value = wpv_do_shortcode(trim($content)); $value = $value / 100; return number_format($value, 2); }
Use the shortcode as follows:
[format_length] [types field="lengte" output="raw"][/types][/format_length]
Where:
Replace "lengte" with your types field name.
Relevant Documentation:
This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.
Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.
Sun | Mon | Tue | Wed | Thu | Fri | Sat |
---|---|---|---|---|---|---|
- | 10:00 – 13:00 | 10:00 – 13:00 | 10:00 – 13:00 | 10:00 – 13:00 | 10:00 – 13:00 | - |
- | 14:00 – 18:00 | 14:00 – 18:00 | 14:00 – 18:00 | 14:00 – 18:00 | 14:00 – 18:00 | - |
Supporter timezone: Asia/Kolkata (GMT+05:30)
This topic contains 2 replies, has 2 voices.
Last updated by mcjS 8 years, 1 month ago.
Assisted by: Minesh.