Skip to content

classes_essentials_localization_numberformat.class

Daniel Spors edited this page Dec 19, 2023 · 3 revisions

Classes in file essentials/localization/numberformat.class.php

class NumberFormat

Helper class to deal with numbers.

Format

Formats a number to string.

Definition: public function Format($number, $decimals=false, $use_plain=false)

Returns: string The formatted string

Parameters:

  • float $number The value

  • int $decimals Number of decimals, defaults to this objects DecimalDigits property

  • bool $use_plain If true skips formatting

StrToNumber

Converts a number matching this objects formatting back to a float.

Definition: public function StrToNumber($str)

Returns: float|bool The number or false on error

Parameters:

  • string $str String containing the formattedc number
Clone this wiki locally