19.10.2010, 11:10
(
Последний раз редактировалось Slice; 19.10.2010 в 14:35.
)
hey,
This is not another number formatter function. With this, you can format any variable type without having to change anything. Before you lose interest, allow me to re-attract your interest by providing a bullet-list!
Examples:
Will print:
Download!
This is not another number formatter function. With this, you can format any variable type without having to change anything. Before you lose interest, allow me to re-attract your interest by providing a bullet-list!
- Set the thousand separator (or disable it)
- Set the number of decimals
- Set the decimal point
- Format hex numbers without getting invalid values on high numbers
Examples:
pawn Код:
new
iNumber = 4864334,
Float:fFloat = 55548623.112,
bool:bFalse = false,
bool:bTrue = true
;
printf( FormatNumber( iNumber ) );
printf( FormatNumber( fFloat, 3, ',', '.' ) );
printf( FormatNumber( bFalse ) );
printf( FormatNumber( bTrue ) );
printf( FormatNumber( fFloat, 0 ) );
printf( FormatNumber( iNumber, 2, 0 ) );
printf( FormatNumber( hex:fFloat ) );
printf( FormatNumber( bit:0b00100110 ) );
printf( FormatNumber( bit_byte:0b10101010101010101010101010101011 ) );
Код:
4 864 334 55,548,624.000 false true 55 548 624 4864334.00 0x4C53E6B4 0b00100110 0b10101010101010101010101010101011