static result Parse(const String& s, double& ret);
/**
- * Gets the @c signed @c char equivalent of the current instance of %Double.
+ * Gets the @c signed @c char equivalent of the current %Double instance.
*
* @since 2.0
*
virtual char ToChar(void) const;
/**
- * Gets the @c signed @c short equivalent of the current instance of %Double.
+ * Gets the @c signed @c short equivalent of the current %Double instance.
*
* @since 2.0
*
virtual short ToShort(void) const;
/**
- * Gets the @c signed @c int equivalent of the current instance of %Double.
+ * Gets the @c signed @c int equivalent of the current %Double instance.
*
* @since 2.0
*
virtual int ToInt(void) const;
/**
- * Gets the @c signed @c long equivalent of the current instance of %Double.
+ * Gets the @c signed @c long equivalent of the current %Double instance.
*
* @since 2.0
*
virtual long ToLong(void) const;
/**
- * Gets the @c signed @c long @c long equivalent of the current instance of %Double.
+ * Gets the @c signed @c long @c long equivalent of the current %Double instance.
*
* @since 2.0
*
virtual long long ToLongLong(void) const;
/**
- * Gets the @c signed @c float equivalent of the current instance of %Double.
+ * Gets the @c signed @c float equivalent of the current %Double instance.
*
* @since 2.0
*
virtual float ToFloat(void) const;
/**
- * Gets the @c signed @c double equivalent of the current instance of %Double.
+ * Gets the @c signed @c double equivalent of the current %Double instance.
*
* @since 2.0
*
virtual double ToDouble(void) const;
/**
- * Gets the string representing the value of the current instance of %Double.
+ * Gets the string representing the value of the current %Double instance.
*
* @since 2.0
*
- * @return A string containing a Unicode representation of the value of the current instance
+ * @return A string containing a Unicode representation of the current instance value.
* @remarks
* - If the value of the current instance is Not-a-Number (NaN), the result is the string "NaN". Furthermore, infinity
* produces the result "Infinity". @n
- * 6 digits are given for the precision of this method. Use String::Format() to set the specific precision.
+ * 6 digits are given for the precision of this method. Use Double::ToString(int precision) to set the specific precision.
* - The behavior of this method is dependent on the system default locale setting.
*/
virtual String ToString(void) const;
/**
+ * Gets the string representing the value of the current %Double instance.
+ *
+ * @since 3.0
+ *
+ * @param[in] precision Number of digits after a decimal separator
+ * @return A string containing a Unicode representation of the current instance value
+ * @remarks
+ * - If the value of the current instance is Not-a-Number (NaN), the result is the string "NaN". Furthermore, infinity
+ * produces the result "Infinity". @n
+ * - The behavior of this method is dependent on the system default locale setting.
+ *
+ * @code
+ *
+ * Double dbl(3.1416);
+ * String str1 = dbl.ToString(3);
+ * // str1 contains "3.142"
+ *
+ * String str2 = dbl.ToString(2);
+ * // str2 contains "3.14"
+ *
+ * @endcode
+ */
+ virtual String ToString(int precision) const;
+
+ /**
* Gets the string representing the specified @c double value.
*
* @since 2.0
* @remarks
* - If the input value is Not-a-Number (NaN), the result is the string "NaN". Furthermore, infinity
* produces the result "Infinity". @n
- * 6 digits are given for the precision of this method. Use String::Format() to set the specific precision.
+ * 6 digits are given for the precision of this method. Use Double::ToString(float value, int precision) to set the specific precision.
* - The behavior of this method is dependent on the system default locale setting.
*/
static String ToString(double value);
/**
+ * Gets the string representing the specified @c double value.
+ *
+ * @since 3.0
+ *
+ * @return A string containing a Unicode representation of the specified @c double value
+ * @param[in] value A @c double value to convert
+ * @param[in] precision Number of digits after a decimal separator
+ * @remarks
+ * - If the input value is Not-a-Number (NaN), the result is the string "NaN". Furthermore, infinity
+ * produces the result "Infinity". @n
+ * - The behavior of this method is dependent on the system default locale setting.
+ *
+ * @code
+ *
+ * String str1 = Double::ToString(3.1416f, 3);
+ * // str1 contains "3.142"
+ *
+ * String str2 = Double::ToString(3.1416f, 2);
+ * // str2 contains "3.14"
+ *
+ * @endcode
+ */
+ static String ToString(double value, int precision);
+
+ /**
* Gets the IEEE 754 floating-point "double format" bit layout representation of the specified @c double value.
*
* @since 2.0
*
* @return The bits that represent the floating-point number in the IEEE 754 floating-point "double format" bit layout
- * @param[in] value A @c double value to convert
+ * @param[in] value A @c double value to convert
*/
static long long ToBits(double value);
}; // Double
}} // Tizen::Base
-#endif //_FBASE_DOUBLE_H_
\ No newline at end of file
+#endif //_FBASE_DOUBLE_H_