/** * Validates amount to ensure it follows the rules of monero * * @param string|float amount * @return bool */ public function valid_amount($amount) { if (!is_numeric($amount)) { return FALSE; } // XMR is limited to 12 decimals if (bc::count_decimals($amount) > 12) { return FALSE; } #// The maximum payment is depended on your system, 32-bit is 10 digits and 64-bit is 19 digits #$max_digits = strlen(PHP_INT_MAX); // PHP 64-bit does not support more than 9223372036854775807 (19-digits) if (bc::is($amount, '>=', '9223372.036854775807')) { return FALSE; } return TRUE; }
/** * Validates amount to ensure it follows the rules of cryptonote * * @param string|float amount * @return bool */ public function valid_amount($amount) { if (!is_numeric($amount)) { return FALSE; } if (bc::count_decimals($amount) > 8) { return FALSE; } return TRUE; }