convertToQuantity method

String convertToQuantity({
  1. required String regionString,
  2. bool removeZeroes = false,
  3. bool replaceComasAndAddDots = false,
})

This getter returns a well formatted quantity as String, if the String can be parsed to double If the value can't be parsed, it just returns its value

Implementation

String convertToQuantity({
  required String regionString,
  bool removeZeroes = false,
  bool replaceComasAndAddDots = false,
}) {
  return quantityFromString(regionString: regionString)
          ?.getFormattedQuantityString(
        regionString: regionString,
        removeZeros: removeZeroes,
        replaceComasAndAddDots: replaceComasAndAddDots,
      ) ??
      this;
}