tryParseWith<R, P extends NumberParserBase<R> >  method 
- P parserGenerator(),
- String text
Parse the number represented by the string using the parser created by the supplied parser generator. If it's not
parsable, returns null.
Implementation
R? tryParseWith<R, P extends NumberParserBase<R>>(
    P Function(NumberFormat, String) parserGenerator, String text) {
  try {
    return parseWith(parserGenerator, text);
  } on FormatException {
    return null;
  }
}