| Index: third_party/WebKit/Source/wtf/dtoa.cpp
|
| diff --git a/third_party/WebKit/Source/wtf/dtoa.cpp b/third_party/WebKit/Source/wtf/dtoa.cpp
|
| index 064397779986e7663d63c49efe7b65cdd2e3f288..dc143e6982a30969a2b89065eaf0572241ee652f 100644
|
| --- a/third_party/WebKit/Source/wtf/dtoa.cpp
|
| +++ b/third_party/WebKit/Source/wtf/dtoa.cpp
|
| @@ -3,7 +3,8 @@
|
| * The author of this software is David M. Gay.
|
| *
|
| * Copyright (c) 1991, 2000, 2001 by Lucent Technologies.
|
| - * Copyright (C) 2002, 2005, 2006, 2007, 2008, 2010, 2012 Apple Inc. All rights reserved.
|
| + * Copyright (C) 2002, 2005, 2006, 2007, 2008, 2010, 2012 Apple Inc.
|
| + * All rights reserved.
|
| *
|
| * Permission to use, copy, modify, and distribute this software for any
|
| * purpose without fee is hereby granted, provided that this entire notice
|
| @@ -91,11 +92,16 @@ static inline const char* formatStringTruncatingTrailingZerosIfNeeded(
|
| const char* numberToFixedPrecisionString(double d,
|
| unsigned significantFigures,
|
| NumberToStringBuffer buffer) {
|
| - // Mimic String::format("%.[precision]g", ...), but use dtoas rounding facilities.
|
| - // "g": Signed value printed in f or e format, whichever is more compact for the given value and precision.
|
| - // The e format is used only when the exponent of the value is less than -4 or greater than or equal to the
|
| - // precision argument. Trailing zeros are truncated, and the decimal point appears only if one or more digits follow it.
|
| - // "precision": The precision specifies the maximum number of significant digits printed.
|
| + // Mimic String::format("%.[precision]g", ...), but use dtoas rounding
|
| + // facilities.
|
| + // "g": Signed value printed in f or e format, whichever is more compact for
|
| + // the given value and precision.
|
| + // The e format is used only when the exponent of the value is less than -4 or
|
| + // greater than or equal to the precision argument. Trailing zeros are
|
| + // truncated, and the decimal point appears only if one or more digits follow
|
| + // it.
|
| + // "precision": The precision specifies the maximum number of significant
|
| + // digits printed.
|
| double_conversion::StringBuilder builder(buffer, NumberToStringBufferLength);
|
| const double_conversion::DoubleToStringConverter& converter =
|
| double_conversion::DoubleToStringConverter::EcmaScriptConverter();
|
| @@ -109,13 +115,15 @@ const char* numberToFixedPrecisionString(double d,
|
| const char* numberToFixedWidthString(double d,
|
| unsigned decimalPlaces,
|
| NumberToStringBuffer buffer) {
|
| - // Mimic String::format("%.[precision]f", ...), but use dtoas rounding facilities.
|
| - // "f": Signed value having the form [ - ]dddd.dddd, where dddd is one or more decimal digits.
|
| - // The number of digits before the decimal point depends on the magnitude of the number, and
|
| - // the number of digits after the decimal point depends on the requested precision.
|
| - // "precision": The precision value specifies the number of digits after the decimal point.
|
| - // If a decimal point appears, at least one digit appears before it.
|
| - // The value is rounded to the appropriate number of digits.
|
| + // Mimic String::format("%.[precision]f", ...), but use dtoas rounding
|
| + // facilities.
|
| + // "f": Signed value having the form [ - ]dddd.dddd, where dddd is one or more
|
| + // decimal digits. The number of digits before the decimal point depends on
|
| + // the magnitude of the number, and the number of digits after the decimal
|
| + // point depends on the requested precision.
|
| + // "precision": The precision value specifies the number of digits after the
|
| + // decimal point. If a decimal point appears, at least one digit appears
|
| + // before it. The value is rounded to the appropriate number of digits.
|
| double_conversion::StringBuilder builder(buffer, NumberToStringBufferLength);
|
| const double_conversion::DoubleToStringConverter& converter =
|
| double_conversion::DoubleToStringConverter::EcmaScriptConverter();
|
|
|