//
-// Open Service Platform
// Copyright (c) 2012 Samsung Electronics Co., Ltd.
//
// Licensed under the Apache License, Version 2.0 (the License);
* @param[out] ret The numeric representation of the string
* @exception E_SUCCESS The method is successful.
* @exception E_NUM_FORMAT The specified string does not contain a number that can be parsed.
- * @remarks This method guarantees that the original value of out-parameter is not changed when the method returns error.
+ * @remarks
+ * - This method guarantees that the original value of out-parameter is not changed when the method returns error.
+ * - The behavior of this method is dependent on the system default locale setting.
* @see Tizen::Base::Double::Parse()
*/
static result Parse(const String& s, float& ret);
/**
- * Gets the @c signed @c char equivalent of the current instance of the %Float class.
+ * Gets the @c signed @c char equivalent of the current %Float instance.
*
* @since 2.0
*
virtual char ToChar(void) const;
/**
- * Gets the @c signed @c short equivalent of the current instance of the %Float class.
+ * Gets the @c signed @c short equivalent of the current %Float instance.
*
* @since 2.0
*
virtual short ToShort(void) const;
/**
- * Gets the @c signed @c int equivalent of the current instance of the %Float class.
+ * Gets the @c signed @c int equivalent of the current %Float instance.
*
* @since 2.0
*
virtual int ToInt(void) const;
/**
- * Gets the @c signed @c long equivalent of the current instance of the %Float class.
+ * Gets the @c signed @c long equivalent of the current %Float instance.
*
* @since 2.0
*
virtual long ToLong(void) const;
/**
- * Gets the @c signed @c long @c long equivalent of the current instance of the %Float class.
+ * Gets the @c signed @c long @c long equivalent of the current %Float instance.
*
* @since 2.0
*
virtual long long ToLongLong(void) const;
/**
- * Gets the @c signed @c float equivalent of the current instance of the %Float class.
+ * Gets the @c signed @c float equivalent of the current %Float instance.
*
* @since 2.0
*
virtual float ToFloat(void) const;
/**
- * Gets the @c signed @c double equivalent of the current instance of the %Float class.
+ * Gets the @c signed @c double equivalent of the current %Float instance.
*
* @since 2.0
*
virtual double ToDouble(void) const;
/**
- * Gets the string representing the value of the current instance of %Float.
+ * Gets the string representing the value of the current %Float instance.
*
* @since 2.0
*
- * @return A string containing a Unicode representation of the value of the current instance
- * @remarks If the value is Not-a-Number (NaN), the result is the string "NaN". Furthermore, infinity
+ * @return A string containing a Unicode representation of the value of the current instance value
+ * @remarks
+ * - If the 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 Float::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 %Float instance.
+ *
+ * @since 3.0
+ *
+ * @param[in] precision Number of digits after a decimal separator
+ * @return A string containing a Unicode representation of the value 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
+ *
+ * Float flt(3.1416);
+ * String str1 = flt.ToString(3);
+ * // str1 contains "3.142"
+ *
+ * String str2 = flt.ToString(2);
+ * // str2 contains "3.14"
+ *
+ * @endcode
+ */
+ virtual String ToString(int precision) const;
+
+ /**
* Gets the string representing the specified @c float value.
*
* @since 2.0
*
* @return A string containing a Unicode representation of the specified @c float value
* @param[in] value A @c float value to convert
- * @remarks If the value is Not-a-Number (NaN), the result is the string "NaN". Furthermore, infinity
+ * @remarks
+ * - If the 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 Float::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(float value);
/**
+ * Gets the string representing the specified @c float value.
+ *
+ * @since 3.0
+ *
+ * @return A string containing a Unicode representation of the specified @c float value
+ * @param[in] value A @c float value to convert
+ * @param[in] precision Number of digits after a decimal separator
+ * @remarks
+ * - If the 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 = Float::ToString(3.1416f, 3);
+ * // str1 contains "3.142"
+ *
+ * String str2 = Float::ToString(3.1416f, 2);
+ * // str2 contains "3.14"
+ *
+ * @endcode
+ */
+ static String ToString(float value, int precision);
+
+
+ /**
* Gets the IEEE 754 floating-point "single format" bit layout representation of the specified @c float value.
*
* @since 2.0
static const int __DBL_MAX_10_EXP = 308;
friend class _FloatImpl;
- class _FloatImpl * __pFloatImpl;
+ class _FloatImpl* __pFloatImpl;
}; // Float