Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 4.1.x will end 13 November 2023 (12 months).
  • Bug fixes for security issues in 4.1.x will end 10 November 2025 (36 months).
  • PHP version: minimum PHP 7.4.0 Note: minimum PHP version has increased since Moodle 4.0. PHP 8.0.x is supported too.

Differences Between: [Versions 400 and 401]

(no description)

File Size: 132 lines (5 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

Dollar:: (3 methods):
  format()
  decimal()
  fractional()


Class: Dollar  - X-Ref

format($number, $precision = 2)   X-Ref
DOLLAR.

This function converts a number to text using currency format, with the decimals rounded to the specified place.
The format used is $#,##0.00_);($#,##0.00)..

param: mixed $number The value to format, or can be an array of numbers
param: mixed $precision The number of digits to display to the right of the decimal point (as an integer).
return: array|string

decimal($fractionalDollar = null, $fraction = 0)   X-Ref
DOLLARDE.

Converts a dollar price expressed as an integer part and a fraction
part into a dollar price expressed as a decimal number.
Fractional dollar numbers are sometimes used for security prices.

Excel Function:
DOLLARDE(fractional_dollar,fraction)

param: mixed $fractionalDollar Fractional Dollar
param: mixed $fraction Fraction
return: array|float|string

fractional($decimalDollar = null, $fraction = 0)   X-Ref
No description