12 if (is_bool($value)) {
16 $value = (int) $value;
19 if (is_numeric($value)) {
21 $value = floor((
float) $value);
25 return strtoupper((
string) $value);
30 if ($places === null) {
34 if (is_numeric($places)) {
35 if ($places < 0 || $places > 10) {
55 if ($places !== null) {
56 if (strlen($value) <= $places) {
57 return substr(str_pad($value, $places,
'0', STR_PAD_LEFT), -10);
63 return substr($value, -10);
const COMPATIBILITY_OPENOFFICE
static validateValue($value)
const COMPATIBILITY_GNUMERIC
static nbrConversionFormat(string $value, ?int $places)
Formats a number base string value with leading zeroes.
static validatePlaces($places=null)
static getCompatibilityMode()
Return the current Compatibility Mode.