[M3devel] Percent to REAL?

Randy Coleburn rcoleburn at scires.com
Fri Jan 16 03:47:54 CET 2009


Martin:
 
The following works for me:
 
VAR
   i: INTEGER;
   r: REAL;
BEGIN
   i := 70;
   r := FLOAT(i) / 100.0;
END;
 
Regards,
Randy

>>> Martin Bishop <martinbishop at bellsouth.net> 1/15/2009 9:25 PM >>>
I'm feeling silly, but I need to convert a percentage (stored as an
INTEGER) into a REAL, so I tried FLOAT(num) / 100.0 but that doesn't
work.  I tried using FLOAT(num DIV 100) but that doesn't work either.  I
also tried FLOAT(num MOD 100) just to try everything, and that didn't
work either.

How can I convert a percentage into a REAL? For example, 70% -> 0.70

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://m3lists.elegosoft.com/pipermail/m3devel/attachments/20090115/ec5b2d93/attachment-0002.html>


More information about the M3devel mailing list