PeterBLITZ / m2tklib

Automatically exported from code.google.com/p/m2tklib
0 stars 0 forks source link

M2_FLOAT #12

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Add float support.
options:
cN
total digits, without "."
.N
digits after the "."

"c4.2"
--> 12.34
"c4.0"
--> 1234

size calculation: num("c") + ( num(".") == 0 ? 0 : num(".")+1 )

Original issue reported on code.google.com by olikr...@gmail.com on 12 Jul 2011 at 9:36

GoogleCodeExporter commented 8 years ago

Original comment by olikr...@gmail.com on 15 Jul 2011 at 10:36

GoogleCodeExporter commented 8 years ago
This was added as addon for M2_U32NUM. The ulong value can be converted
to float with

float f = (float)u32_value;
for( i = 0; i < dot_value; i++)
  f /= 10.0;

Original comment by olikr...@gmail.com on 15 Jul 2011 at 9:48