INNER CODE UNIT · Dart

TypesHelper

jhomlala/feather · lib/src/utils/types_helper.dart:3

class TypesHelper {
  static double toDouble(num? val) {
    try {
      if (val == null) {
        return 0;
      }
      if (val is double) {
        return val;
      } else {
        return val.toDouble();
      }
    } catch (exception, stackTrace) {
      Log.e("toDouble failed: $exception $stackTrace");
      return 0;
    }
  }
}

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…