Scale
final t1 = Fixed.fromInt(12, scale: 1); // == 1.2, scale: 1
final t2 = Fixed.fromInt(2, scale: 2); // == 2.00, scale: 2
final t3 = t1 + t2; // == 2.20, scale: 2
final t3 = t1 * t2; // == 2.40, scale: 3
final t1 = Fixed.fromInt(12, scale: 1); // == 1.2, scale: 1
final t2 = Fixed.fromInt(2, scale: 2); // == 2.00, scale: 2
final t3 = t1 * t2; // == 2.40, scale: 3 final t7 = Fixed.fromNum(1.234, scale: 3); // == 1.234, scale: 3
/// reduce the scale
final t8 = Fixed.copyWith(t7, scale: 2); // == 1.23, scale: 2
/// increase the scale
final t9 = Fixed.copyWith(t8, scale: 5); // == 1.2300, scale: 5Last updated
Was this helpful?