directy VIP
Total posts: 51
04 Jan 2016 12:41

Hi, this row in my custom template show a size in mm.

``` Lenght: fields_by_id[39]->result; ?> mm.

the result is like: Lenght: 101 mm.

is there a way to add a pice of code (in the template) to add a conversion in inch? something like this

Lenght: 101 mm. / 3.97in.

thanks maarco


Sackgesicht VIP
Total posts: 1,636
04 Jan 2016 13:23

Maybe something like this:

<?php echo "/ ".($item->fields_by_id[39]->result/0.039370)." inch";?>

untested ....


directy VIP
Total posts: 51
04 Jan 2016 15:13

thanks very much! it works.

here my modification to round it...

<?php echo round ($item->fields_by_id[39]->result/25.4, 1, PHP_ROUND_HALF_UP) ; ?>

marco

Powered by Cobalt