parseMeasure static method

String parseMeasure(
  1. double price
)

Implementation

static String parseMeasure(double price) {
  if (price % 1 == 0) {
    return NumberFormat.decimalPattern().format(price.round());
  }
  return NumberFormat.decimalPattern().format(double.parse(price.toStringAsFixed(1)));
}