function satoshitize($satoshitize) {

return sprintf("%.8f", $satoshitize);

}

function satoshitrim($satoshitrim) {

return rtrim(rtrim($satoshitrim, "0"), ".");

}

$Amount_To_Clean = "0.0234045395636709999";



$Amount_of_Bitcoin = satoshitrim(satoshitize($Amount_To_Clean));



echo $Amount_of_Bitcoin;



Some simple PHP functions to help format numbers used as Bitcoin amounts and balances. Main usage is after doing math with 2 Bitcoin amounts. It prevents the output from showing those annoying scientific notations like 1.0E-6A function to modify a number to bitcoin formatExample: 0.00120000A function to trim trailing zeroes and decimal if wanted after satoshitizing a numberExamples:10.00023100 = 10.0002311.000 = 110.000 = 10Example usage:The above would output 0.02340453