decimalformat.html

来自「API資料大全」· HTML 代码 · 共 1,215 行 · 第 1/5 页

HTML
1,215
字号
<CODE>&nbsp;<A HREF="../../java/lang/String.html">String</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../java/text/DecimalFormat.html#getPositivePrefix()">getPositivePrefix</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Get the positive prefix.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../../java/lang/String.html">String</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../java/text/DecimalFormat.html#getPositiveSuffix()">getPositiveSuffix</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Get the positive suffix.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;int</CODE></FONT></TD><TD><CODE><B><A HREF="../../java/text/DecimalFormat.html#hashCode()">hashCode</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Overrides hashCode</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;boolean</CODE></FONT></TD><TD><CODE><B><A HREF="../../java/text/DecimalFormat.html#isDecimalSeparatorAlwaysShown()">isDecimalSeparatorAlwaysShown</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Allows you to get the behavior of the decimal separator with integers.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../../java/lang/Number.html">Number</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../java/text/DecimalFormat.html#parse(java.lang.String, java.text.ParsePosition)">parse</A></B>(<A HREF="../../java/lang/String.html">String</A>&nbsp;text,      <A HREF="../../java/text/ParsePosition.html">ParsePosition</A>&nbsp;parsePosition)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns an instance of <code>Number</code> with a value matching the given string.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="../../java/text/DecimalFormat.html#setDecimalFormatSymbols(java.text.DecimalFormatSymbols)">setDecimalFormatSymbols</A></B>(<A HREF="../../java/text/DecimalFormatSymbols.html">DecimalFormatSymbols</A>&nbsp;newSymbols)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets the decimal format symbols, which is generally not changed by the programmer or user.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="../../java/text/DecimalFormat.html#setDecimalSeparatorAlwaysShown(boolean)">setDecimalSeparatorAlwaysShown</A></B>(boolean&nbsp;newValue)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Allows you to set the behavior of the decimal separator with integers.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="../../java/text/DecimalFormat.html#setGroupingSize(int)">setGroupingSize</A></B>(int&nbsp;newValue)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Set the grouping size.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="../../java/text/DecimalFormat.html#setMaximumFractionDigits(int)">setMaximumFractionDigits</A></B>(int&nbsp;newValue)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets the maximum number of digits allowed in the fraction portion of a number.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="../../java/text/DecimalFormat.html#setMaximumIntegerDigits(int)">setMaximumIntegerDigits</A></B>(int&nbsp;newValue)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets the maximum number of digits allowed in the integer portion of a number.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="../../java/text/DecimalFormat.html#setMinimumFractionDigits(int)">setMinimumFractionDigits</A></B>(int&nbsp;newValue)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets the minimum number of digits allowed in the fraction portion of a number.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="../../java/text/DecimalFormat.html#setMinimumIntegerDigits(int)">setMinimumIntegerDigits</A></B>(int&nbsp;newValue)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets the minimum number of digits allowed in the integer portion of a number.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="../../java/text/DecimalFormat.html#setMultiplier(int)">setMultiplier</A></B>(int&nbsp;newValue)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Set the multiplier for use in percent, permill, etc.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="../../java/text/DecimalFormat.html#setNegativePrefix(java.lang.String)">setNegativePrefix</A></B>(<A HREF="../../java/lang/String.html">String</A>&nbsp;newValue)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Set the negative prefix.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="../../java/text/DecimalFormat.html#setNegativeSuffix(java.lang.String)">setNegativeSuffix</A></B>(<A HREF="../../java/lang/String.html">String</A>&nbsp;newValue)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Set the positive suffix.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="../../java/text/DecimalFormat.html#setPositivePrefix(java.lang.String)">setPositivePrefix</A></B>(<A HREF="../../java/lang/String.html">String</A>&nbsp;newValue)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Set the positive prefix.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="../../java/text/DecimalFormat.html#setPositiveSuffix(java.lang.String)">setPositiveSuffix</A></B>(<A HREF="../../java/lang/String.html">String</A>&nbsp;newValue)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Set the positive suffix.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../../java/lang/String.html">String</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../java/text/DecimalFormat.html#toLocalizedPattern()">toLocalizedPattern</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Synthesizes a localized pattern string that represents the current state of this Format object.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../../java/lang/String.html">String</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../java/text/DecimalFormat.html#toPattern()">toPattern</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Synthesizes a pattern string that represents the current state of this Format object.</TD></TR></TABLE>&nbsp;<A NAME="methods_inherited_from_class_java.text.NumberFormat"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"><TD><B>Methods inherited from class java.text.<A HREF="../../java/text/NumberFormat.html">NumberFormat</A></B></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><A HREF="../../java/text/NumberFormat.html#format(double)">format</A>, <A HREF="../../java/text/NumberFormat.html#format(long)">format</A>, <A HREF="../../java/text/NumberFormat.html#format(java.lang.Object, java.lang.StringBuffer, java.text.FieldPosition)">format</A>, <A HREF="../../java/text/NumberFormat.html#getAvailableLocales()">getAvailableLocales</A>, <A HREF="../../java/text/NumberFormat.html#getCurrencyInstance()">getCurrencyInstance</A>, <A HREF="../../java/text/NumberFormat.html#getCurrencyInstance(java.util.Locale)">getCurrencyInstance</A>, <A HREF="../../java/text/NumberFormat.html#getInstance()">getInstance</A>, <A HREF="../../java/text/NumberFormat.html#getInstance(java.util.Locale)">getInstance</A>, <A HREF="../../java/text/NumberFormat.html#getMaximumFractionDigits()">getMaximumFractionDigits</A>, <A HREF="../../java/text/NumberFormat.html#getMaximumIntegerDigits()">getMaximumIntegerDigits</A>, <A HREF="../../java/text/NumberFormat.html#getMinimumFractionDigits()">getMinimumFractionDigits</A>, <A HREF="../../java/text/NumberFormat.html#getMinimumIntegerDigits()">getMinimumIntegerDigits</A>, <A HREF="../../java/text/NumberFormat.html#getNumberInstance()">getNumberInstance</A>, <A HREF="../../java/text/NumberFormat.html#getNumberInstance(java.util.Locale)">getNumberInstance</A>, <A HREF="../../java/text/NumberFormat.html#getPercentInstance()">getPercentInstance</A>, <A HREF="../../java/text/NumberFormat.html#getPercentInstance(java.util.Locale)">getPercentInstance</A>, <A HREF="../../java/text/NumberFormat.html#isGroupingUsed()">isGroupingUsed</A>, <A HREF="../../java/text/NumberFormat.html#isParseIntegerOnly()">isParseIntegerOnly</A>, <A HREF="../../java/text/NumberFormat.html#parse(java.lang.String)">parse</A>, <A HREF="../../java/text/NumberFormat.html#parseObject(java.lang.String, java.text.ParsePosition)">parseObject</A>, <A HREF="../../java/text/NumberFormat.html#setGroupingUsed(boolean)">setGroupingUsed</A>, <A HREF="../../java/text/NumberFormat.html#setParseIntegerOnly(boolean)">setParseIntegerOnly</A></CODE></TD></TR></TABLE>&nbsp;<A NAME="methods_inherited_from_class_java.text.Format"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"><TD><B>Methods inherited from class java.text.<A HREF="../../java/text/Format.html">Format</A></B></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><A HREF="../../java/text/Format.html#format(java.lang.Object)">format</A>, <A HREF="../../java/text/Format.html#parseObject(java.lang.String)">parseObject</A></CODE></TD></TR></TABLE>&nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"><TD><B>Methods inherited from class java.lang.<A HREF="../../java/lang/Object.html">Object</A></B></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><A HREF="../../java/lang/Object.html#finalize()">finalize</A>, <A HREF="../../java/lang/Object.html#getClass()">getClass</A>, <A HREF="../../java/lang/Object.html#notify()">notify</A>, <A HREF="../../java/lang/Object.html#notifyAll()">notifyAll</A>, <A HREF="../../java/lang/Object.html#toString()">toString</A>, <A HREF="../../java/lang/Object.html#wait()">wait</A>, <A HREF="../../java/lang/Object.html#wait(long)">wait</A>, <A HREF="../../java/lang/Object.html#wait(long, int)">wait</A></CODE></TD></TR></TABLE>&nbsp;<P><!-- ============ FIELD DETAIL =========== --><!-- ========= CONSTRUCTOR DETAIL ======== --><A NAME="constructor_detail"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=1><FONT SIZE="+2"><B>Constructor Detail</B></FONT></TD></TR></TABLE><A NAME="DecimalFormat()"><!-- --></A><H3>DecimalFormat</H3><PRE>public <B>DecimalFormat</B>()</PRE><DL><DD>Create a DecimalFormat using the default pattern and symbols for the default locale. This is a convenient way to obtain a DecimalFormat when internationalization is not the main concern. <p> To obtain standard formats for a given locale, use the factory methods on NumberFormat such as getNumberInstance. These factories will return the most appropriate sub-class of NumberFormat for a given locale.<DD><DL><DT><B>See Also: </B><DD><A HREF="../../java/text/NumberFormat.html#getInstance()"><CODE>NumberFormat.getInstance()</CODE></A>, <A HREF="../../java/text/NumberFormat.html#getNumberInstance()"><CODE>NumberFormat.getNumberInstance()</CODE></A>, <A HREF="../../java/text/NumberFormat.html#getCurrencyInstance()"><CODE>NumberFormat.getCurrencyInstance()</CODE></A>, <A HREF="../../java/text/NumberFormat.html#getPercentInstance()"><CODE>NumberFormat.getPercentInstance()</CODE></A></DL></DD></DL><HR><A NAME="DecimalFormat(java.lang.String)"><!-- --></A><H3>DecimalFormat</H3><PRE>public <B>DecimalFormat</B>(<A HREF="../../java/lang/String.html">String</A>&nbsp;pattern)</PRE><DL><DD>Create a DecimalFormat from the given pattern and the symbols for the default locale. This is a convenient way to obtain a DecimalFormat when internationalization is not the main concern. <p> To obtain standard formats for a given locale, use the factory methods on NumberFormat such as getNumberInstance. These factories will return the most appropriate sub-class of NumberFormat for a given locale.<DD><DL><DT><B>Parameters:</B><DD><CODE>pattern</CODE> - A non-localized pattern string.<DT><B>Throws:</B><DD><CODE><A HREF="../../java/lang/IllegalArgumentException.html">IllegalArgumentException</A></CODE> - if the given pattern is invalid.<DT><B>See Also: </B><DD><A HREF="../../java/text/NumberFormat.html#getInstance()"><CODE>NumberFormat.getInstance()</CODE></A>, <A HREF="../../java/text/NumberFormat.html#getNumberInstance()"><CODE>NumberFormat.getNumberInstance()</CODE></A>, <A HREF="../../java/text/NumberFormat.html#getCurrencyInstance()"><CODE>NumberFormat.getCurrencyInstance()</CODE></A>, <A HREF="../../java/text/NumberFormat.html#getPercentInstance()"><CODE>NumberFormat.getPercentInstance()</CODE></A></DL></DD></DL>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?