Closed arnezt closed 5 years ago
If you want to show a number you can use this variant from w8io project:
function w8io_amount( $amount, $decimals, $pad = 20 )
{
if( $amount < 0 )
{
$sign = '-';
$amount = -$amount;
}
else
$sign = '';
$amount = (string)$amount;
if( $decimals )
{
if( strlen( $amount ) <= $decimals )
$amount = str_pad( $amount, $decimals + 1, '0', STR_PAD_LEFT );
$amount = substr_replace( $amount, '.', -$decimals, 0 );
}
$amount = $sign . $amount;
return $pad ? str_pad( $amount, $pad, ' ', STR_PAD_LEFT ) : $amount;
}
All right. Thank you very much for your kind to response. I'll try your function.
Hello sir.. I still confuse how to convert the prices on Waves with PHP. I have use the code like something below: