Пример #1
0
 public static bool TryFormat(this float value, Span <byte> buffer, out int bytesWritten, TextFormat format, EncodingData encoding)
 {
     if (format.IsDefault)
     {
         format.Symbol = 'G';
     }
     Precondition.Require(format.Symbol == 'G');
     return(FloatFormatter.TryFormatNumber(value, true, buffer, out bytesWritten, format, encoding));
 }
Пример #2
0
 public static bool TryFormat(this double value, Span <byte> buffer, Format.Parsed format, EncodingData formattingData, out int bytesWritten)
 {
     if (format.IsDefault)
     {
         format.Symbol = 'G';
     }
     Precondition.Require(format.Symbol == 'G');
     return(FloatFormatter.TryFormatNumber(value, false, buffer, format, formattingData, out bytesWritten));
 }
Пример #3
0
 public static bool TryFormat(this double value, Span <byte> buffer, out int bytesWritten, TextFormat format = default, SymbolTable symbolTable = null)
 {
     if (format.IsDefault)
     {
         format.Symbol = 'G';
     }
     Precondition.Require(format.Symbol == 'G');
     symbolTable = symbolTable ?? SymbolTable.InvariantUtf8;
     return(FloatFormatter.TryFormatNumber(value, false, buffer, out bytesWritten, format, symbolTable));
 }
Пример #4
0
 public static bool TryFormat(this double 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, false, buffer, out bytesWritten, format, encoder));
 }