CAST
This function bring data to specified type.
First function argument is type name, to which is produced the bringing: "i[nteger]", "o[ctal]", "d[ecimal]", "h[exadecimal]", "f[loat]" или "s[string]".
Second function argument - given value.
Call function example:
<TMPL_var CAST("int", 1.345)>
1
<TMPL_var CAST('int', "010")>
8
<TMPL_var CAST('dec', "010")>
10
<TMPL_var CAST('oct', "010")>
8
<TMPL_var CAST('hex', "010")>
16
<TMPL_var CAST("float", var1)>
Caution!
If specified format is "i[nteger]", function will bringing data on the following algorithm:
- value reading as hexadecimal number, if started from 0x or 0X
- value reading as octal number, if started from 0
- in all other cases value reading as decimal number
Copyright © 2003 - 2010 CTPP Dev. Team | http://ctpp.havoc.ru