[Date Prev][Date Next][Thread Prev][Thread Next][Minivend by date
][Minivend by thread
]
Re: [mv] Again [calc]
On 9 Nov, Ben-Nes Michael wrote:
> ****** message to minivend-users from Ben-Nes Michael <miki@canaan.co.il> ******
>
> Oops I lost all my new mails so i didn't noticed if someone answered me
> :-(
> Please re send the answer
>
> Hi
>
> I do: [calc][item-field Length] / 2.54[/calc]
> but i get accurate number (at least 8 numbers after the point)
>
> So, How can I suppress the result to two points after the point.
Maybe this can help you:
For example...
[calc] 11 / 2.54[/calc]<BR>
the output is 4.33070866141732
[set name="out" interpolate=1][calc] 11 / 2.54[/calc][/set]
scratch out is: [scratch out]<BR>
the output is 4.33070866141732
[perl arg=scratch]
$_ = $Safe{'scratch'}{'out'};
$a = sprintf "%.2f", $_;
$Safe{'scratch'}{'out'}= $a;
return '';
[/perl]
scratch out is: [scratch out]<BR>
the output is 4.33
Regards,
Joachim
--
Hans-Joachim Leidinger
buch online jojo@buchonline.net
Munscheidstr. 14 FAX: +49 209 1971449
45886 Gelsenkirchen