public static void ConvertToJson(StringBuilder b, double arg, int decimals, DoubleArrayConverterVersion ver) { if (ver == DoubleArrayConverterVersion.Default || !(arg < 9223372036854775807d && arg > -9223372036854775808d)) { b.Append(DefaultJsonImplementation(arg)); } else if (ver == DoubleArrayConverterVersion.V1) { DoubleFormatterV1.Optimized_N_Digits(b, arg, decimals); } else if (ver == DoubleArrayConverterVersion.V2) { DoubleFormatterV2.Optimized_N_Digits(b, arg, decimals); } else if (ver == DoubleArrayConverterVersion.V3) { DoubleFormatterV3.Optimized_N_Digits(b, arg, decimals); } }
public static void ConvertToJson(StringBuilder b, double?argNullable, int decimals, DoubleArrayConverterVersion ver) { if (argNullable == null) { b.Append("null"); } else { ConvertToJson(b, argNullable.Value, decimals, ver); } }