Hi all,

I am doing conversions from square metres to square feet for example.

I have a regex that removes any commas or spaces in a number.

I then do the conversion

return an integer

but then want to display the number with the commas or spaces put back in 
to make it easier to read.

What do you suggest?


                my $units = iwpt_dcr_value('dcr.lettableArea.units');
                my $area = iwpt_dcr_value('dcr.lettableArea.Area');
 
                $modifiedArea =~ s/,\s//;
 
                $squareMetres = ( $units eq 'square metres' ) ? $area : 
int $modifiedArea * 0.0929;
                $squareFeet     = ( $units eq 'square feet' )      ? $area 
: int $modifiedArea * 10.764;
 
                $lettableArea = $squareMetres .qq[m<sup>2</sup> or ] . 
$squareFeet . qq[f<sup>2</sup> (approx)];
 
                iwpt_output( $lettableArea );

Regards

Colin

Reply via email to