Пример #1
0
 public static bool TryFormat(this double value, Span <byte> buffer, out int bytesWritten, ParsedFormat format = default, SymbolTable symbolTable = null)
 {
     if (format.IsDefault)
     {
         format = 'G';
     }
     Precondition.Require(format.Symbol == 'G');
     symbolTable = symbolTable ?? SymbolTable.InvariantUtf8;
     return(FloatFormatter.TryFormatNumber(value, false, buffer, out bytesWritten, format, symbolTable));
 }
Пример #2
0
 public static bool TryFormat(this float value, Span <byte> buffer, out int bytesWritten, TextFormat format = default(TextFormat), TextEncoder encoder = null)
 {
     if (format.IsDefault)
     {
         format.Symbol = 'G';
     }
     Precondition.Require(format.Symbol == 'G');
     encoder = encoder == null ? TextEncoder.Utf8 : encoder;
     return(FloatFormatter.TryFormatNumber(value, true, buffer, out bytesWritten, format, encoder));
 }