Formats a number with specific min- and max-Fraction-Digits (localized) und scientific notation.



Syntax

ormat_reportNumber(mixed $number, ?string $fmtType = 'num', ?string $fmtDecimal = '1.0-2'): string

  • $number
    The number to format.

  • $fmtType Output Format
    M
    • "num" | NULL - Normal number format
    • "si" - Scientific notation, with unit appended, e.g. "u","m","K","M","G", ...
    • "byte" - Recalculated number in bytes with appropriate Unit, e.g. "4,5 KByte".
    • "duration" - Time duration of number in seconds, e.g. "hh:mm:ss".
    • "task-duration" - TIme duration of number in seconds, recalculated for 5 workdays, 8 hours/day: E.g. "2w 3d 8h 30m".

  • $fmtDecimal
    Determines how many  leading digits and fraction-digits shall be shown. 
    String format is:   "<num digits>.<minFrac>-<maxFrac>"
    E.g. "1.0-2"


Examples

Numbers

{{ hublify.format_reportNumber( 123456.1 , 0, 4) }}    =>    123.456,1