Price.fromMicros constructor

Price.fromMicros(
  1. int micros,
  2. String currencyCode
)

Creates a Price from a micros value (1 unit = 1/1,000,000 of the currency).

Converts micros to cents via integer division: micros ~/ 10000.

Implementation

factory Price.fromMicros(int micros, String currencyCode) {
  return Price(amountCents: micros ~/ 10000, currencyCode: currencyCode);
}