Fixed.copyWith constructor
Returns a new Fixed value from an existing one
changing the scale to scale
.
Implementation
factory Fixed.copyWith(Fixed fixed, {int? scale}) {
scale ??= fixed.scale;
_checkScale(scale);
return Fixed.fromDecimal(
_rescale(fixed.value, existingScale: fixed.scale, targetScale: scale),
scale: scale);
}