public static bool TryFormat(float value, Span <byte> buffer, out int bytesWritten, ParsedFormat format = default, SymbolTable symbolTable = null) { if (format.IsDefault) { format = 'G'; } symbolTable = symbolTable ?? SymbolTable.InvariantUtf8; switch (format.Symbol) { case 'G': return(CustomFormatter.TryFormatNumber(value, true, buffer, out bytesWritten, format, symbolTable)); default: throw new NotSupportedException(); } }
/// <summary> /// /// </summary> /// <param name="value"></param> /// <param name="buffer"></param> /// <param name="bytesWritten"></param> /// <param name="format">only 'G' format is supported</param> /// <returns></returns> public static bool TryFormat(float value, Span <byte> buffer, out int bytesWritten, StandardFormat format = default) => CustomFormatter.TryFormat(value, buffer, out bytesWritten, format, SymbolTable.InvariantUtf8);