Using Cent to Represent Currency

Double, float, they shouldn't be used for anything that requires accuracy.

There are some numbers which cannot be represented accurately using float point representation. Consider, for example, pi. How would you represent a number which has infinite digits, within a finite storage? http://stackoverflow.com/a/960078

function denominate($int){
    return number_format($int/100, 2);
}

References:

results matching ""

    No results matching ""