dollars static method

String dollars(
  1. num? dollarsVal, [
  2. int decimals = 2,
  3. String symbol = "\$"
])

Formats dollars value into currency representation.

Implementation

static String dollars(num? dollarsVal, [int decimals = 2, String symbol = "\$"]) {
  if (dollarsVal == null) return "";
  return cents(dollarsVal * 100, decimals, symbol);
}