class NumUtils {
  /// 展示小数
  ///
  /// - 去除多余的0
  ///
  /// [val] 数值
  ///
  /// [placeholder] 空数值占位
  static String displayDouble(double? val, [String placeholder = ""]) {
    if (val == null) {
      return placeholder;
    }
    if (val == val.round()) {
      return val.round().toString();
    } else {
      return val.toString();
    }
  }
}
