decimalformat.html

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

HTML
1,215
字号
<DD>Allows you to get the behavior of the decimal separator with integers. (The decimal separator will always appear with decimals.) <P>Example: Decimal ON: 12345 -> 12345.; OFF: 12345 -> 12345</DL><HR><A NAME="setDecimalSeparatorAlwaysShown(boolean)"><!-- --></A><H3>setDecimalSeparatorAlwaysShown</H3><PRE>public void <B>setDecimalSeparatorAlwaysShown</B>(boolean&nbsp;newValue)</PRE><DL><DD>Allows you to set the behavior of the decimal separator with integers. (The decimal separator will always appear with decimals.) <P>Example: Decimal ON: 12345 -> 12345.; OFF: 12345 -> 12345</DL><HR><A NAME="clone()"><!-- --></A><H3>clone</H3><PRE>public <A HREF="../../java/lang/Object.html">Object</A> <B>clone</B>()</PRE><DL><DD>Standard override; no change in semantics.<DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../java/text/NumberFormat.html#clone()">clone</A></CODE> in class <CODE><A HREF="../../java/text/NumberFormat.html">NumberFormat</A></CODE></DL></DD><DD>Following copied from class: <CODE>java.lang.Object</CODE></DD><DD><DL><DT><B>Returns:</B><DD>a clone of this instance.<DT><B>Throws:</B><DD><CODE><A HREF="../../java/lang/CloneNotSupportedException.html">CloneNotSupportedException</A></CODE> - if the object's class does not               support the <code>Cloneable</code> interface. Subclasses               that override the <code>clone</code> method can also               throw this exception to indicate that an instance cannot               be cloned.<DD><CODE><A HREF="../../java/lang/OutOfMemoryError.html">OutOfMemoryError</A></CODE> - if there is not enough memory.<DT><B>See Also: </B><DD><A HREF="../../java/lang/Cloneable.html"><CODE>Cloneable</CODE></A></DL></DD></DL><HR><A NAME="equals(java.lang.Object)"><!-- --></A><H3>equals</H3><PRE>public boolean <B>equals</B>(<A HREF="../../java/lang/Object.html">Object</A>&nbsp;obj)</PRE><DL><DD>Overrides equals<DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../java/text/NumberFormat.html#equals(java.lang.Object)">equals</A></CODE> in class <CODE><A HREF="../../java/text/NumberFormat.html">NumberFormat</A></CODE></DL></DD><DD>Following copied from class: <CODE>java.lang.Object</CODE></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>obj</CODE> - the reference object with which to compare.<DT><B>Returns:</B><DD><code>true</code> if this object is the same as the obj          argument; <code>false</code> otherwise.<DT><B>See Also: </B><DD><A HREF="../../java/lang/Boolean.html#hashCode()"><CODE>Boolean.hashCode()</CODE></A>, <A HREF="../../java/util/Hashtable.html"><CODE>Hashtable</CODE></A></DL></DD></DL><HR><A NAME="hashCode()"><!-- --></A><H3>hashCode</H3><PRE>public int <B>hashCode</B>()</PRE><DL><DD>Overrides hashCode<DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../java/text/NumberFormat.html#hashCode()">hashCode</A></CODE> in class <CODE><A HREF="../../java/text/NumberFormat.html">NumberFormat</A></CODE></DL></DD><DD>Following copied from class: <CODE>java.lang.Object</CODE></DD><DD><DL><DT><B>Returns:</B><DD>a hash code value for this object.<DT><B>See Also: </B><DD><A HREF="../../java/lang/Object.html#equals(java.lang.Object)"><CODE>Object.equals(java.lang.Object)</CODE></A>, <A HREF="../../java/util/Hashtable.html"><CODE>Hashtable</CODE></A></DL></DD></DL><HR><A NAME="toPattern()"><!-- --></A><H3>toPattern</H3><PRE>public <A HREF="../../java/lang/String.html">String</A> <B>toPattern</B>()</PRE><DL><DD>Synthesizes a pattern string that represents the current state of this Format object.<DD><DL><DT><B>See Also: </B><DD><A HREF="../../java/text/DecimalFormat.html#applyPattern(java.lang.String)"><CODE>applyPattern(java.lang.String)</CODE></A></DL></DD></DL><HR><A NAME="toLocalizedPattern()"><!-- --></A><H3>toLocalizedPattern</H3><PRE>public <A HREF="../../java/lang/String.html">String</A> <B>toLocalizedPattern</B>()</PRE><DL><DD>Synthesizes a localized pattern string that represents the current state of this Format object.<DD><DL><DT><B>See Also: </B><DD><A HREF="../../java/text/DecimalFormat.html#applyPattern(java.lang.String)"><CODE>applyPattern(java.lang.String)</CODE></A></DL></DD></DL><HR><A NAME="applyPattern(java.lang.String)"><!-- --></A><H3>applyPattern</H3><PRE>public void <B>applyPattern</B>(<A HREF="../../java/lang/String.html">String</A>&nbsp;pattern)</PRE><DL><DD>Apply the given pattern to this Format object.  A pattern is a short-hand specification for the various formatting properties. These properties can also be changed individually through the various setter methods. <p> There is no limit to integer digits are set by this routine, since that is the typical end-user desire; use setMaximumInteger if you want to set a real value. For negative numbers, use a second pattern, separated by a semicolon <P>Example "#,#00.0#" -> 1,234.56 <P>This means a minimum of 2 integer digits, 1 fraction digit, and a maximum of 2 fraction digits. <p>Example: "#,#00.0#;(#,#00.0#)" for negatives in parantheses. <p>In negative patterns, the minimum and maximum counts are ignored; these are presumed to be set in the positive pattern.</DL><HR><A NAME="applyLocalizedPattern(java.lang.String)"><!-- --></A><H3>applyLocalizedPattern</H3><PRE>public void <B>applyLocalizedPattern</B>(<A HREF="../../java/lang/String.html">String</A>&nbsp;pattern)</PRE><DL><DD>Apply the given pattern to this Format object.  The pattern is assumed to be in a localized notation. A pattern is a short-hand specification for the various formatting properties. These properties can also be changed individually through the various setter methods. <p> There is no limit to integer digits are set by this routine, since that is the typical end-user desire; use setMaximumInteger if you want to set a real value. For negative numbers, use a second pattern, separated by a semicolon <P>Example "#,#00.0#" -> 1,234.56 <P>This means a minimum of 2 integer digits, 1 fraction digit, and a maximum of 2 fraction digits. <p>Example: "#,#00.0#;(#,#00.0#)" for negatives in parantheses. <p>In negative patterns, the minimum and maximum counts are ignored; these are presumed to be set in the positive pattern.</DL><HR><A NAME="setMaximumIntegerDigits(int)"><!-- --></A><H3>setMaximumIntegerDigits</H3><PRE>public void <B>setMaximumIntegerDigits</B>(int&nbsp;newValue)</PRE><DL><DD>Sets the maximum number of digits allowed in the integer portion of a number. This override limits the integer digit count to 309.<DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../java/text/NumberFormat.html#setMaximumIntegerDigits(int)">setMaximumIntegerDigits</A></CODE> in class <CODE><A HREF="../../java/text/NumberFormat.html">NumberFormat</A></CODE></DL></DD><DD><DL><DT><B>See Also: </B><DD><A HREF="../../java/text/NumberFormat.html#setMaximumIntegerDigits(int)"><CODE>NumberFormat.setMaximumIntegerDigits(int)</CODE></A></DL></DD></DL><HR><A NAME="setMinimumIntegerDigits(int)"><!-- --></A><H3>setMinimumIntegerDigits</H3><PRE>public void <B>setMinimumIntegerDigits</B>(int&nbsp;newValue)</PRE><DL><DD>Sets the minimum number of digits allowed in the integer portion of a number. This override limits the integer digit count to 309.<DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../java/text/NumberFormat.html#setMinimumIntegerDigits(int)">setMinimumIntegerDigits</A></CODE> in class <CODE><A HREF="../../java/text/NumberFormat.html">NumberFormat</A></CODE></DL></DD><DD><DL><DT><B>See Also: </B><DD><A HREF="../../java/text/NumberFormat.html#setMinimumIntegerDigits(int)"><CODE>NumberFormat.setMinimumIntegerDigits(int)</CODE></A></DL></DD></DL><HR><A NAME="setMaximumFractionDigits(int)"><!-- --></A><H3>setMaximumFractionDigits</H3><PRE>public void <B>setMaximumFractionDigits</B>(int&nbsp;newValue)</PRE><DL><DD>Sets the maximum number of digits allowed in the fraction portion of a number. This override limits the fraction digit count to 340.<DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../java/text/NumberFormat.html#setMaximumFractionDigits(int)">setMaximumFractionDigits</A></CODE> in class <CODE><A HREF="../../java/text/NumberFormat.html">NumberFormat</A></CODE></DL></DD><DD><DL><DT><B>See Also: </B><DD><A HREF="../../java/text/NumberFormat.html#setMaximumFractionDigits(int)"><CODE>NumberFormat.setMaximumFractionDigits(int)</CODE></A></DL></DD></DL><HR><A NAME="setMinimumFractionDigits(int)"><!-- --></A><H3>setMinimumFractionDigits</H3><PRE>public void <B>setMinimumFractionDigits</B>(int&nbsp;newValue)</PRE><DL><DD>Sets the minimum number of digits allowed in the fraction portion of a number. This override limits the fraction digit count to 340.<DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../java/text/NumberFormat.html#setMinimumFractionDigits(int)">setMinimumFractionDigits</A></CODE> in class <CODE><A HREF="../../java/text/NumberFormat.html">NumberFormat</A></CODE></DL></DD><DD><DL><DT><B>See Also: </B><DD><A HREF="../../java/text/NumberFormat.html#setMinimumFractionDigits(int)"><CODE>NumberFormat.setMinimumFractionDigits(int)</CODE></A></DL></DD></DL><!-- ========= END OF CLASS DATA ========= --><HR><!-- ========== START OF NAVBAR ========== --><A NAME="navbar_bottom"><!-- --></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0"><TR><TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><A NAME="navbar_bottom_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3">  <TR ALIGN="center" VALIGN="top">  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/DecimalFormat.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>  </TR></TABLE></TD><TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM><b>Java<sup><font size=-2>TM</font></sup>&nbsp;2&nbsp;Platform<br>Std.&nbsp;Ed. v1.3</b></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">&nbsp;<A HREF="../../java/text/DateFormatSymbols.html"><B>PREV CLASS</B></A>&nbsp;&nbsp;<A HREF="../../java/text/DecimalFormatSymbols.html"><B>NEXT CLASS</B></A></FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">  <A HREF="../../index.html" TARGET="_top"><B>FRAMES</B></A>  &nbsp;&nbsp;<A HREF="DecimalFormat.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">  SUMMARY: &nbsp;INNER&nbsp;|&nbsp;<A HREF="#fields_inherited_from_class_java.text.NumberFormat">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL: &nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD></TR></TABLE><!-- =========== END OF NAVBAR =========== --><HR><font size="-1"><a href="http://java.sun.com/cgi-bin/bugreport.cgi">Submit a bug or feature</a><br>For further API reference and developer documentation, see <a href="http://java.sun.com/products/jdk/1.3/devdocs-vs-specs.html">Java 2 SDK SE Developer Documentation</a>. That documentation  contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples. <p>Java, Java 2D, and JDBC are trademarks or registered trademarks of Sun Microsystems, Inc. in the US and other countries.<br>Copyright 1993-2000 Sun Microsystems, Inc. 901 San Antonio Road<br>Palo Alto, California, 94303, U.S.A.  All Rights Reserved.</font></BODY></HTML>

⌨️ 快捷键说明

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