|
|
|
@ -69,7 +69,7 @@ import java.util.regex.Pattern;
|
|
|
|
|
* <li>Construct a new formatter object using one of the factory methods.
|
|
|
|
|
* <li>Format a value by passing it as an argument to the
|
|
|
|
|
* {@link BtcFormat#format(Object)} method.
|
|
|
|
|
* <li>Parse a value by passing a <code>String</code>-type
|
|
|
|
|
* <li>Parse a value by passing a {@code String}-type
|
|
|
|
|
* representation of it to the {@link BtcFormat#parse(String)} method.</ol>
|
|
|
|
|
*
|
|
|
|
|
* <p>For example, depending on your locale, values might be formatted
|
|
|
|
@ -96,10 +96,10 @@ import java.util.regex.Pattern;
|
|
|
|
|
* auto-denominating formatter is defined by its style, specified by one of the enumerated
|
|
|
|
|
* values of {@link BtcAutoFormat.Style}. There are two styles constants: {@link
|
|
|
|
|
* BtcAutoFormat.Style#CODE} (the default), and {@link BtcAutoFormat.Style#SYMBOL}. The
|
|
|
|
|
* difference is that the <code>CODE</code> style uses an internationally-distinct currency
|
|
|
|
|
* code, such as <code>"BTC"</code>, to indicate the units of denomination, while the
|
|
|
|
|
* <code>SYMBOL</code> style uses a possibly-ambiguous currency symbol such as
|
|
|
|
|
* <code>"฿"</code>.
|
|
|
|
|
* difference is that the {@code CODE} style uses an internationally-distinct currency
|
|
|
|
|
* code, such as {@code "BTC"}, to indicate the units of denomination, while the
|
|
|
|
|
* {@code SYMBOL} style uses a possibly-ambiguous currency symbol such as
|
|
|
|
|
* {@code "฿"}.
|
|
|
|
|
*
|
|
|
|
|
* <p>The denomination used when formatting will be either bitcoin, millicoin
|
|
|
|
|
* or microcoin, depending on the value being represented, chosen so as to minimize the number
|
|
|
|
@ -114,9 +114,9 @@ import java.util.regex.Pattern;
|
|
|
|
|
* defined by its scale, which is the number of places one must shift the decimal point in
|
|
|
|
|
* increasing precision to convert the representation of a given quantity of bitcoins into a
|
|
|
|
|
* representation of the same value denominated in the formatter's units. For example, a scale
|
|
|
|
|
* value of <code>3</code> specifies a denomination of millibitcoins, because to represent
|
|
|
|
|
* <code>1.0000 BTC</code>, or one bitcoin, in millibitcoins, one shifts the decimal point
|
|
|
|
|
* three places, that is, to <code>1000.0 mBTC</code>.
|
|
|
|
|
* value of {@code 3} specifies a denomination of millibitcoins, because to represent
|
|
|
|
|
* {@code 1.0000 BTC}, or one bitcoin, in millibitcoins, one shifts the decimal point
|
|
|
|
|
* three places, that is, to {@code 1000.0 mBTC}.
|
|
|
|
|
*
|
|
|
|
|
* <h3>Construction</h3>
|
|
|
|
|
*
|
|
|
|
@ -125,7 +125,7 @@ import java.util.regex.Pattern;
|
|
|
|
|
* <li>Use a {@link BtcFormat.Builder} object.</ol>
|
|
|
|
|
*
|
|
|
|
|
* <p>The factory methods are appropriate for basic use where the default
|
|
|
|
|
* configuration is either used or modified. The <code>Builder</code>
|
|
|
|
|
* configuration is either used or modified. The {@link Builder}
|
|
|
|
|
* class provides more control over the configuration, and gives
|
|
|
|
|
* access to some features not available through the factory methods,
|
|
|
|
|
* such as using custom formatting patterns and currency symbols.
|
|
|
|
@ -134,14 +134,14 @@ import java.util.regex.Pattern;
|
|
|
|
|
*
|
|
|
|
|
* Although formatting and parsing is performed by one of the concrete
|
|
|
|
|
* subclasses, you can obtain formatters using the various static factory
|
|
|
|
|
* methods of this abstract base class <code>BtcFormat</code>. There
|
|
|
|
|
* methods of this abstract base class {@link BtcFormat}. There
|
|
|
|
|
* are a variety of overloaded methods that allow you to obtain a
|
|
|
|
|
* formatter that behaves according to your needs.
|
|
|
|
|
*
|
|
|
|
|
* <p>The primary distinction is between automatic- and
|
|
|
|
|
* fixed-denomination formatters. By default, the
|
|
|
|
|
* <code>getInstance()</code> method with no arguments returns a new,
|
|
|
|
|
* automatic-denominating <code>BtcAutoFormat</code> instance for your
|
|
|
|
|
* {@code getInstance()} method with no arguments returns a new,
|
|
|
|
|
* automatic-denominating {@link BtcAutoFormat} instance for your
|
|
|
|
|
* default locale that will display exactly two fractional decimal
|
|
|
|
|
* places and a currency code. For example, if you happen to be in
|
|
|
|
|
* the USA:
|
|
|
|
@ -151,10 +151,10 @@ import java.util.regex.Pattern;
|
|
|
|
|
* String s = f.format(Coin.COIN); <strong>// "BTC 1.00"</strong>
|
|
|
|
|
* </pre></blockquote>
|
|
|
|
|
*
|
|
|
|
|
* <p>The first argument to <code>getInstance()</code> can determine
|
|
|
|
|
* <p>The first argument to {@code getInstance()} can determine
|
|
|
|
|
* whether you get an auto- or fixed-denominating formatter. If the
|
|
|
|
|
* type of the first argument is an <code>int</code>, then the value
|
|
|
|
|
* of that <code>int</code> will be interpreted as the decimal-place scale of
|
|
|
|
|
* type of the first argument is an {@code int}, then the value
|
|
|
|
|
* of that {@code int} will be interpreted as the decimal-place scale of
|
|
|
|
|
* the {@link BtcFixedFormat} instance that is returned, and thus will
|
|
|
|
|
* determine its denomination. For example, if you want to format
|
|
|
|
|
* values in units of microbitcoins:
|
|
|
|
@ -168,9 +168,9 @@ import java.util.regex.Pattern;
|
|
|
|
|
* <blockquote><pre>BtcFormat milliFormat = BtcFormat.getInstance(MILLICOIN_SCALE);</pre></blockquote>
|
|
|
|
|
*
|
|
|
|
|
* <p>Alternatively, if the type of the first argument to
|
|
|
|
|
* <code>getInstance()</code> is one of the enumerated values of the
|
|
|
|
|
* {@link BtcAutoFormat.Style} type, either <code>CODE</code> or
|
|
|
|
|
* <code>SYMBOL</code>, then you will get a {@link BtcAutoFormat}
|
|
|
|
|
* {@code getInstance()} is one of the enumerated values of the
|
|
|
|
|
* {@link BtcAutoFormat.Style} type, either {@link BtcAutoFormat.Style#CODE} or
|
|
|
|
|
* {@link BtcAutoFormat.Style#SYMBOL}, then you will get a {@link BtcAutoFormat}
|
|
|
|
|
* instance that uses either a currency code or symbol, respectively,
|
|
|
|
|
* to indicate the results of its auto-denomination.
|
|
|
|
|
*
|
|
|
|
@ -185,15 +185,15 @@ import java.util.regex.Pattern;
|
|
|
|
|
* is to use one of the factory methods that is named to indicate that characteristics of the
|
|
|
|
|
* new instance returned. For fixed-denomination formatters, these methods are {@link
|
|
|
|
|
* #getCoinInstance()}, {@link #getMilliInstance()}, and {@link #getMicroInstance()}. These
|
|
|
|
|
* three methods are equivalent to invoking <code>getInstance()</code> with a first argument of
|
|
|
|
|
* <code>0</code>, <code>3</code> and <code>6</code>, respectively. For auto-denominating
|
|
|
|
|
* three methods are equivalent to invoking {@code getInstance()} with a first argument of
|
|
|
|
|
* {@code 0}, {@code 3} and {@code 6}, respectively. For auto-denominating
|
|
|
|
|
* formatters the relevant factory methods are {@link #getCodeInstance()} and {@link
|
|
|
|
|
* #getSymbolInstance()}, which are equivalent to <code>getInstance(Style.CODE)</code>, and
|
|
|
|
|
* <code>getInstance(Style.SYMBOL)</code>.
|
|
|
|
|
* #getSymbolInstance()}, which are equivalent to {@code getInstance(Style.CODE)}, and
|
|
|
|
|
* {@code getInstance(Style.SYMBOL)}.
|
|
|
|
|
*
|
|
|
|
|
* <p>Regardless of how you specify whether your new formatter is to be of automatic- or
|
|
|
|
|
* fixed-denomination, the next (and possibly first) parameter to each of the factory methods
|
|
|
|
|
* is an optional <code>Locale</code> value.
|
|
|
|
|
* is an optional {@link Locale} value.
|
|
|
|
|
*
|
|
|
|
|
* For example, here we construct four instances for the same locale that each format
|
|
|
|
|
* differently the same one-bitcoin value:
|
|
|
|
@ -209,33 +209,33 @@ import java.util.regex.Pattern;
|
|
|
|
|
* BtcFormat.getInstance(4, Locale.GERMANY).format(Coin.COIN);
|
|
|
|
|
* </pre></blockquote>
|
|
|
|
|
*
|
|
|
|
|
* Omitting such a <code>Locale</code> parameter will give you a
|
|
|
|
|
* Omitting such a {@link Locale} parameter will give you a
|
|
|
|
|
* formatter for your default locale.
|
|
|
|
|
*
|
|
|
|
|
* <p>The final (and possibly only) arguments to the factory methods serve to set the default
|
|
|
|
|
* number of fractional decimal places that will be displayed when formatting monetary values.
|
|
|
|
|
* In the case of an auto-denominating formatter, this can be a single <code>int</code> value,
|
|
|
|
|
* In the case of an auto-denominating formatter, this can be a single {@code int} value,
|
|
|
|
|
* which will determine the number of fractional decimal places to be used in all cases, except
|
|
|
|
|
* where either (1) doing so would provide a place for fractional satoshis, or (2) that default
|
|
|
|
|
* value is overridden when invoking the <code>format()</code> method as described below.
|
|
|
|
|
* value is overridden when invoking the {@code format()} method as described below.
|
|
|
|
|
*
|
|
|
|
|
* <p>In the case of a fixed-denomination formatter, you can pass any number of
|
|
|
|
|
* <code>int</code> values. The first will determine the minimum number of fractional decimal
|
|
|
|
|
* places, and each following <code>int</code> value specifies the size of an optional group of
|
|
|
|
|
* {@code int} values. The first will determine the minimum number of fractional decimal
|
|
|
|
|
* places, and each following {@code int} value specifies the size of an optional group of
|
|
|
|
|
* decimal-places to be displayed only if useful for expressing precision. As with auto-denominating
|
|
|
|
|
* formatters, numbers will never be formatted with a decimal place that represents a
|
|
|
|
|
* fractional quantity of satoshis, and these defaults can be overridden by arguments to the
|
|
|
|
|
* <code>format()</code> method. See below for examples.
|
|
|
|
|
* {@code format()} method. See below for examples.
|
|
|
|
|
*
|
|
|
|
|
* <h5>The <code>Builder</code> Class</h5>
|
|
|
|
|
* <h5>The {@link Builder} Class</h5>
|
|
|
|
|
*
|
|
|
|
|
* A new {@link BtcFormat.Builder} instance is returned by the {@link #builder()} method. Such
|
|
|
|
|
* an object has methods that set the configuration parameters of a <code>BtcFormat</code>
|
|
|
|
|
* object. Its {@link Builder#build()} method constructs and returns a <code>BtcFormat</code> instance
|
|
|
|
|
* an object has methods that set the configuration parameters of a {@link BtcFormat}
|
|
|
|
|
* object. Its {@link Builder#build()} method constructs and returns a {@link BtcFormat} instance
|
|
|
|
|
* configured according to those settings.
|
|
|
|
|
*
|
|
|
|
|
* <p>In addition to setter-methods that correspond to the factory-method parameters explained
|
|
|
|
|
* above, a <code>Builder</code> also allows you to specify custom formatting and parsing
|
|
|
|
|
* above, a {@link Builder} also allows you to specify custom formatting and parsing
|
|
|
|
|
* patterns and currency symbols and codes. For example, rather than using the default
|
|
|
|
|
* currency symbol, which has the same unicode character point as the national currency symbol of
|
|
|
|
|
* Thailand, some people prefer to use a capital letter "B" with a vertical overstrike.
|
|
|
|
@ -248,7 +248,7 @@ import java.util.regex.Pattern;
|
|
|
|
|
* String out = f.format(COIN); <strong>// "B⃦1.00" depending on locale</strong>
|
|
|
|
|
* </pre></blockquote>
|
|
|
|
|
*
|
|
|
|
|
* The <code>Builder</code> methods are chainable. So, for example, if you are
|
|
|
|
|
* The {@link Builder} methods are chainable. So, for example, if you are
|
|
|
|
|
* deferential to ISO 4217, you might construct a formatter in a single line this way:
|
|
|
|
|
*
|
|
|
|
|
* <blockquote><pre>
|
|
|
|
@ -267,18 +267,18 @@ import java.util.regex.Pattern;
|
|
|
|
|
* number of satoshis, while a {@link java.math.BigDecimal} is interpreted as representing a
|
|
|
|
|
* number of bitcoins. A value having a fractional amount of satoshis is rounded to the
|
|
|
|
|
* nearest whole satoshi at least, and possibly to a greater unit depending on the number of
|
|
|
|
|
* fractional decimal-places displayed. The <code>format()</code> method will not accept an
|
|
|
|
|
* argument whose type is <code>String</code>, <code>Float</code> nor <code>Double</code>.
|
|
|
|
|
* fractional decimal-places displayed. The {@code format()} method will not accept an
|
|
|
|
|
* argument whose type is {@link String}, {@link Float} nor {@link Double}.
|
|
|
|
|
*
|
|
|
|
|
* <p>Subsequent to the monetary value to be formatted, the {@link #format(Object)} method also
|
|
|
|
|
* accepts as arguments optional <code>int</code> values that specify the number of decimal
|
|
|
|
|
* accepts as arguments optional {@code int} values that specify the number of decimal
|
|
|
|
|
* places to use to represent the fractional portion of the number. This overrides the
|
|
|
|
|
* default, and enables a single formatter instance to be reused, formatting different values
|
|
|
|
|
* that require different numbers of fractional decimal places. These parameters have the same
|
|
|
|
|
* meaning as those that set the default values in the factory methods as described above.
|
|
|
|
|
* Namely, a single <code>int</code> value determines the minimum number of fractional decimal
|
|
|
|
|
* Namely, a single {@code int} value determines the minimum number of fractional decimal
|
|
|
|
|
* places that will be used in all cases, to a precision limit of satoshis. Instances of
|
|
|
|
|
* {@link BtcFixedFormat} also accept a variable-length sequence of additional <code>int</code>
|
|
|
|
|
* {@link BtcFixedFormat} also accept a variable-length sequence of additional {@code int}
|
|
|
|
|
* values, each of which specifies the size of a group of fractional decimal-places to be used
|
|
|
|
|
* in addition to all preceding places, only if useful to express precision, and only to a
|
|
|
|
|
* maximum precision of satoshis. For example:
|
|
|
|
@ -330,8 +330,8 @@ import java.util.regex.Pattern;
|
|
|
|
|
* </pre></blockquote>
|
|
|
|
|
*
|
|
|
|
|
* <p>When using a fixed-denomination formatter whose scale can be expressed as a standard
|
|
|
|
|
* "metric" prefix, you can invoke the <code>code()</code> and <code>symbol()</code> methods to
|
|
|
|
|
* obtain a <code>String</code> whose value is the appropriate currency code or symbol,
|
|
|
|
|
* "metric" prefix, you can invoke the {@code code()} and {@code symbol()} methods to
|
|
|
|
|
* obtain a {@link String} whose value is the appropriate currency code or symbol,
|
|
|
|
|
* respectively, for that formatter.
|
|
|
|
|
*
|
|
|
|
|
* <blockquote><pre>
|
|
|
|
@ -392,11 +392,11 @@ import java.util.regex.Pattern;
|
|
|
|
|
*
|
|
|
|
|
* <h3>Parsing</h3>
|
|
|
|
|
*
|
|
|
|
|
* <p>The {@link #parse(String)} method accepts a <code>String</code> argument, and returns a
|
|
|
|
|
* <p>The {@link #parse(String)} method accepts a {@link String} argument, and returns a
|
|
|
|
|
* {@link Coin}-type value. The difference in parsing behavior between instances of {@link
|
|
|
|
|
* BtcFixedFormat} and {@link BtcAutoFormat} is analogous to the difference in formatting
|
|
|
|
|
* behavior between instances of those classes. Instances of {@link BtcAutoFormat} recognize
|
|
|
|
|
* currency codes and symbols in the <code>String</code> being parsed, and interpret them as
|
|
|
|
|
* currency codes and symbols in the {@link String} being parsed, and interpret them as
|
|
|
|
|
* indicators of the units in which the number being parsed is denominated. On the other hand,
|
|
|
|
|
* instances of {@link BtcFixedFormat} by default recognize no codes nor symbols, but rather
|
|
|
|
|
* interpret every number as being denominated in the units that were specified when
|
|
|
|
@ -408,21 +408,21 @@ import java.util.regex.Pattern;
|
|
|
|
|
* {@link BtcAutoFormat} configured with applicable non-default pattern) will recognize a
|
|
|
|
|
* variety of currency symbols and codes, including all standard international (metric)
|
|
|
|
|
* prefixes from micro to mega. For example, denominational units of microcoins may be
|
|
|
|
|
* specified by <code>µ฿</code>, <code>u฿</code>, <code>µB⃦</code>, <code>µɃ</code>,
|
|
|
|
|
* <code>µBTC</code> or other appropriate permutations of those characters. Additionally, if
|
|
|
|
|
* specified by {@code µ฿}, {@code u฿}, {@code µB⃦}, {@code µɃ},
|
|
|
|
|
* {@code µBTC} or other appropriate permutations of those characters. Additionally, if
|
|
|
|
|
* either or both of a custom currency code or symbol is configured using {@link
|
|
|
|
|
* BtcFormat.Builder#code} or {@link BtcFormat.Builder#code}, then such code or symbol will
|
|
|
|
|
* be recognized in addition to those recognized by default..
|
|
|
|
|
*
|
|
|
|
|
* <p>Instances of this class that recognize currency signs will recognize both currency
|
|
|
|
|
* symbols and codes, regardless of which that instance uses for formatting. However, if the
|
|
|
|
|
* style is <code>CODE</code> (and unless overridden by a custom pattern) then a space character must
|
|
|
|
|
* separate the units indicator from the number. When parsing with a <code>SYMBOL</code>-style
|
|
|
|
|
* <code>BtcFormat</code> instance, on the other hand, whether or not the units indicator must
|
|
|
|
|
* style is {@code CODE} (and unless overridden by a custom pattern) then a space character must
|
|
|
|
|
* separate the units indicator from the number. When parsing with a {@code SYMBOL}-style
|
|
|
|
|
* {@code BtcFormat} instance, on the other hand, whether or not the units indicator must
|
|
|
|
|
* be separated by a space from the number is determined by the locale. The {@link
|
|
|
|
|
* BtcFormat#pattern()} method returns a representation of the pattern that
|
|
|
|
|
* can be examined to determine whether a space must separate currency signs from numbers in
|
|
|
|
|
* parsed <code>String</code>s.
|
|
|
|
|
* parsed {@link String}s.
|
|
|
|
|
*
|
|
|
|
|
* <p>When parsing, if the currency-units indicator is absent, then a {@link BtcAutoFormat}
|
|
|
|
|
* instance will infer a denomination of bitcoins while a {@link BtcFixedFormat} will infer the
|
|
|
|
@ -431,10 +431,10 @@ import java.util.regex.Pattern;
|
|
|
|
|
* units indicator, that space must be present in the String to be parsed, even if the units
|
|
|
|
|
* indicator is absent.
|
|
|
|
|
*
|
|
|
|
|
* <p>The <code>parse()</code> method returns an instance of the
|
|
|
|
|
* <p>The {@code parse()} method returns an instance of the
|
|
|
|
|
* {@link Coin} class. Therefore, attempting to parse a value greater
|
|
|
|
|
* than the maximum that a <code>Coin</code> object can represent will
|
|
|
|
|
* raise a <code>ParseException</code>, as will any other detected
|
|
|
|
|
* than the maximum that a {@code Coin} object can represent will
|
|
|
|
|
* raise a {@code ParseException}, as will any other detected
|
|
|
|
|
* parsing error.
|
|
|
|
|
*
|
|
|
|
|
* <h3>Limitations</h3>
|
|
|
|
@ -505,16 +505,16 @@ public abstract class BtcFormat extends Format {
|
|
|
|
|
protected final List<Integer> decimalGroups;
|
|
|
|
|
|
|
|
|
|
/* Scale is the number of decimal-places difference from same value in bitcoins */
|
|
|
|
|
/** A constant useful for specifying a denomination of bitcoins, the <code>int</code> value
|
|
|
|
|
* <code>0</code>. */
|
|
|
|
|
/** A constant useful for specifying a denomination of bitcoins, the {@code int} value
|
|
|
|
|
* {@code 0}. */
|
|
|
|
|
public static final int COIN_SCALE = 0;
|
|
|
|
|
|
|
|
|
|
/** A constant useful for specifying a denomination of millibitcoins, the <code>int</code>
|
|
|
|
|
* value <code>3</code>. */
|
|
|
|
|
/** A constant useful for specifying a denomination of millibitcoins, the {@code int}
|
|
|
|
|
* value {@code 3}. */
|
|
|
|
|
public static final int MILLICOIN_SCALE = 3;
|
|
|
|
|
|
|
|
|
|
/** A constant useful for specifying a denomination of microbitcoins, the <code>int</code>
|
|
|
|
|
* value <code>6</code>. */
|
|
|
|
|
/** A constant useful for specifying a denomination of microbitcoins, the {@code int}
|
|
|
|
|
* value {@code 6}. */
|
|
|
|
|
public static final int MICROCOIN_SCALE = 6;
|
|
|
|
|
|
|
|
|
|
/** Return the number of decimal places by which any value denominated in the
|
|
|
|
@ -526,12 +526,12 @@ public abstract class BtcFormat extends Format {
|
|
|
|
|
/**
|
|
|
|
|
* <p>This class constructs new instances of {@link BtcFormat}, allowing for the
|
|
|
|
|
* configuration of those instances before they are constructed. After obtaining a
|
|
|
|
|
* <code>Builder</code> object from the {@link BtcFormat#builder()} method, invoke the
|
|
|
|
|
* {@code Builder} object from the {@link BtcFormat#builder()} method, invoke the
|
|
|
|
|
* necessary setter methods to obtain your desired configuration. Finaly, the {@link
|
|
|
|
|
* #build()} method returns a new <code>BtcFormat</code> object that has the specified
|
|
|
|
|
* #build()} method returns a new {@code BtcFormat} object that has the specified
|
|
|
|
|
* configuration.
|
|
|
|
|
*
|
|
|
|
|
* <p>All the setter methods override defaults. Invoking <code>build()</code> without invoking any
|
|
|
|
|
* <p>All the setter methods override defaults. Invoking {@code build()} without invoking any
|
|
|
|
|
* of the setting methods is equivalent to invoking {@link BtcFormat#getInstance()} with no arguments.
|
|
|
|
|
*
|
|
|
|
|
* <p>Each setter methods returns the same instance on which it is invoked,
|
|
|
|
@ -562,11 +562,11 @@ public abstract class BtcFormat extends Format {
|
|
|
|
|
|
|
|
|
|
private Builder() {}
|
|
|
|
|
|
|
|
|
|
/** Specify the new <code>BtcFormat</code> is to be automatically-denominating.
|
|
|
|
|
* The argument determines which of either codes or symbols the new <code>BtcFormat</code>
|
|
|
|
|
/** Specify the new {@code BtcFormat} is to be automatically-denominating.
|
|
|
|
|
* The argument determines which of either codes or symbols the new {@code BtcFormat}
|
|
|
|
|
* will use by default to indicate the denominations it chooses when formatting values.
|
|
|
|
|
*
|
|
|
|
|
* <p>Note that the <code>Style</code> argument specifies the
|
|
|
|
|
* <p>Note that the {@code Style} argument specifies the
|
|
|
|
|
* <em>default</em> style, which is overridden by invoking
|
|
|
|
|
* either {@link #pattern(String)} or {@link #localizedPattern(String)}.
|
|
|
|
|
*
|
|
|
|
@ -584,24 +584,24 @@ public abstract class BtcFormat extends Format {
|
|
|
|
|
* This is equivalent to the {@link #minimumFractionDigits(int)} method, but named
|
|
|
|
|
* appropriately for the context of generating {@link BtcAutoFormat} instances.
|
|
|
|
|
*
|
|
|
|
|
* <p>If neither this method nor <code>minimumFactionDigits()</code> is invoked, the default value
|
|
|
|
|
* will be <code>2</code>. */
|
|
|
|
|
* <p>If neither this method nor {@code minimumFactionDigits()} is invoked, the default value
|
|
|
|
|
* will be {@code 2}. */
|
|
|
|
|
public Builder fractionDigits(int val) { return minimumFractionDigits(val); }
|
|
|
|
|
|
|
|
|
|
/** Specify a fixed-denomination of units to use when formatting and parsing values.
|
|
|
|
|
* The argument specifies the number of decimal places, in increasing
|
|
|
|
|
* precision, by which each formatted value will differ from that same value
|
|
|
|
|
* denominated in bitcoins. For example, a denomination of millibitcoins is specified
|
|
|
|
|
* with a value of <code>3</code>.
|
|
|
|
|
* with a value of {@code 3}.
|
|
|
|
|
*
|
|
|
|
|
* <p>The <code>BtcFormat</code> class provides appropriately named
|
|
|
|
|
* <code>int</code>-type constants for the three common values, {@link BtcFormat#COIN_SCALE},
|
|
|
|
|
* <p>The {@code BtcFormat} class provides appropriately named
|
|
|
|
|
* {@code int}-type constants for the three common values, {@link BtcFormat#COIN_SCALE},
|
|
|
|
|
* {@link BtcFormat#MILLICOIN_SCALE} {@link BtcFormat#MICROCOIN_SCALE}.
|
|
|
|
|
*
|
|
|
|
|
* <p>If neither this method nor {@link #style(BtcAutoFormat.Style)} is invoked on a
|
|
|
|
|
* <code>Builder</code>, then the <code>BtcFormat</code> will default to a
|
|
|
|
|
* {@link Builder}, then the {@link BtcFormat} will default to a
|
|
|
|
|
* fixed-denomination of bitcoins, equivalent to invoking this method with an argument
|
|
|
|
|
* of <code>0</code>. */
|
|
|
|
|
* of {@code 0}. */
|
|
|
|
|
public Builder scale(int val) {
|
|
|
|
|
if (variant == Variant.AUTO)
|
|
|
|
|
throw new IllegalStateException("You cannot invoke both scale() and style()");
|
|
|
|
@ -614,8 +614,8 @@ public abstract class BtcFormat extends Format {
|
|
|
|
|
* This method is equivalent to {@link #fractionDigits(int)}, but named appropriately for
|
|
|
|
|
* the context of generating a fixed-denomination formatter.
|
|
|
|
|
*
|
|
|
|
|
* <p>If neither this method nor <code>fractionDigits()</code> is invoked, the default value
|
|
|
|
|
* will be <code>2</code>. */
|
|
|
|
|
* <p>If neither this method nor {@code fractionDigits()} is invoked, the default value
|
|
|
|
|
* will be {@code 2}. */
|
|
|
|
|
public Builder minimumFractionDigits(int val) { minimumFractionDigits = val; return this; }
|
|
|
|
|
|
|
|
|
|
/** Specify the sizes of a variable number of optional decimal-place groups in the
|
|
|
|
@ -625,7 +625,7 @@ public abstract class BtcFormat extends Format {
|
|
|
|
|
* satoshis.
|
|
|
|
|
*
|
|
|
|
|
* <p>If this method is not invoked, then the number of fractional decimal places will
|
|
|
|
|
* be limited to the value passed to {@link #minimumFractionDigits}, or <code>2</code>
|
|
|
|
|
* be limited to the value passed to {@link #minimumFractionDigits}, or {@code 2}
|
|
|
|
|
* if that method is not invoked. */
|
|
|
|
|
public Builder fractionGroups(int... val) { fractionGroups = val; return this; }
|
|
|
|
|
|
|
|
|
@ -635,7 +635,7 @@ public abstract class BtcFormat extends Format {
|
|
|
|
|
|
|
|
|
|
/** Specify a currency symbol to be used in the denomination-unit indicators
|
|
|
|
|
* of formatted values. This method only sets the symbol, but does not cause
|
|
|
|
|
* it to be used. You must also invoke either <code>style(SYMBOL)</code>, or else apply
|
|
|
|
|
* it to be used. You must also invoke either {@code style(SYMBOL)}, or else apply
|
|
|
|
|
* a custom pattern that includes a single currency-sign character by invoking either
|
|
|
|
|
* {@link #pattern(String)} or {@link #localizedPattern(String)}.
|
|
|
|
|
*
|
|
|
|
@ -645,7 +645,7 @@ public abstract class BtcFormat extends Format {
|
|
|
|
|
|
|
|
|
|
/** Specify a custom currency code to be used in the denomination-unit indicators
|
|
|
|
|
* of formatted values. This method only sets the code, but does not cause
|
|
|
|
|
* it to be used. You must also invoke either <code>style(CODE)</code>, or else apply
|
|
|
|
|
* it to be used. You must also invoke either {@code style(CODE)}, or else apply
|
|
|
|
|
* a custom pattern that includes a double currency-sign character by invoking either
|
|
|
|
|
* {@link #pattern(String)} or {@link #localizedPattern(String)}.
|
|
|
|
|
*
|
|
|
|
@ -684,7 +684,7 @@ public abstract class BtcFormat extends Format {
|
|
|
|
|
* pattern is identical to the patterns used by the {@link java.text.DecimalFormat}
|
|
|
|
|
* class.
|
|
|
|
|
*
|
|
|
|
|
* <p>The pattern is localized according to the locale of the <code>BtcFormat</code>
|
|
|
|
|
* <p>The pattern is localized according to the locale of the {@code BtcFormat}
|
|
|
|
|
* instance, the symbols for which can be examined by inspecting the {@link
|
|
|
|
|
* java.text.DecimalFormatSymbols} object returned by {@link BtcFormat#symbols()}.
|
|
|
|
|
* So, for example, if you are in Germany, then the non-localized pattern of
|
|
|
|
@ -715,7 +715,7 @@ public abstract class BtcFormat extends Format {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** Return a new {@link BtcFormat} instance. The object returned will be configured according
|
|
|
|
|
* to the state of this <code>Builder</code> instance at the time this method is invoked. */
|
|
|
|
|
* to the state of this {@code Builder} instance at the time this method is invoked. */
|
|
|
|
|
public BtcFormat build() {
|
|
|
|
|
BtcFormat f = variant.newInstance(this);
|
|
|
|
|
if (symbol != "" || code != "") { synchronized(f.numberFormat) {
|
|
|
|
@ -762,7 +762,7 @@ public abstract class BtcFormat extends Format {
|
|
|
|
|
/**
|
|
|
|
|
* Return a new instance of this class using all defaults. The returned formatter will
|
|
|
|
|
* auto-denominate values so as to minimize zeros without loss of precision and display a
|
|
|
|
|
* currency code, for example "<code>BTC</code>", to indicate that denomination. The
|
|
|
|
|
* currency code, for example "{@code BTC}", to indicate that denomination. The
|
|
|
|
|
* returned object will uses the default locale for formatting the number and placement of
|
|
|
|
|
* the currency-code. Two fractional decimal places will be displayed in all formatted numbers.
|
|
|
|
|
*/
|
|
|
|
@ -770,14 +770,14 @@ public abstract class BtcFormat extends Format {
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Return a new auto-denominating instance that will indicate units using a currency
|
|
|
|
|
* symbol, for example, <code>"฿"</code>. Formatting and parsing will be done
|
|
|
|
|
* symbol, for example, {@code "฿"}. Formatting and parsing will be done
|
|
|
|
|
* according to the default locale.
|
|
|
|
|
*/
|
|
|
|
|
public static BtcFormat getSymbolInstance() { return getSymbolInstance(defaultLocale()); }
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Return a new auto-denominating instance that will indicate units using a currency
|
|
|
|
|
* code, for example, <code>"BTC"</code>. Formatting and parsing will be done
|
|
|
|
|
* code, for example, {@code "BTC"}. Formatting and parsing will be done
|
|
|
|
|
* according to the default locale.
|
|
|
|
|
*/
|
|
|
|
|
public static BtcFormat getCodeInstance() { return getCodeInstance(defaultLocale()); }
|
|
|
|
@ -785,7 +785,7 @@ public abstract class BtcFormat extends Format {
|
|
|
|
|
/**
|
|
|
|
|
* Return a new symbol-style auto-formatter with the given number of fractional decimal
|
|
|
|
|
* places. Denominational units will be indicated using a currency symbol, for example,
|
|
|
|
|
* <code>"฿"</code>. The returned object will format the fraction-part of numbers using
|
|
|
|
|
* {@code "฿"}. The returned object will format the fraction-part of numbers using
|
|
|
|
|
* the given number of decimal places, or fewer as necessary to avoid giving a place to
|
|
|
|
|
* fractional satoshis. Formatting and parsing will be done according to the default
|
|
|
|
|
* locale.
|
|
|
|
@ -797,7 +797,7 @@ public abstract class BtcFormat extends Format {
|
|
|
|
|
/**
|
|
|
|
|
* Return a new code-style auto-formatter with the given number of fractional decimal
|
|
|
|
|
* places. Denominational units will be indicated using a currency code, for example,
|
|
|
|
|
* <code>"BTC"</code>. The returned object will format the fraction-part of numbers using
|
|
|
|
|
* {@code "BTC"}. The returned object will format the fraction-part of numbers using
|
|
|
|
|
* the given number of decimal places, or fewer as necessary to avoid giving a place to
|
|
|
|
|
* fractional satoshis. Formatting and parsing will be done according to the default
|
|
|
|
|
* locale.
|
|
|
|
@ -809,14 +809,14 @@ public abstract class BtcFormat extends Format {
|
|
|
|
|
/**
|
|
|
|
|
* Return a new code-style auto-formatter for the given locale. The returned object will
|
|
|
|
|
* select denominational units based on each value being formatted, and will indicate those
|
|
|
|
|
* units using a currency code, for example, <code>"mBTC"</code>.
|
|
|
|
|
* units using a currency code, for example, {@code "mBTC"}.
|
|
|
|
|
*/
|
|
|
|
|
public static BtcFormat getInstance(Locale locale) { return getCodeInstance(locale); }
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Return a new code-style auto-formatter for the given locale. The returned object will
|
|
|
|
|
* select denominational units based on each value being formatted, and will indicate those
|
|
|
|
|
* units using a currency code, for example, <code>"mBTC"</code>.
|
|
|
|
|
* units using a currency code, for example, {@code "mBTC"}.
|
|
|
|
|
*/
|
|
|
|
|
public static BtcFormat getCodeInstance(Locale locale) { return getInstance(CODE, locale); }
|
|
|
|
|
|
|
|
|
@ -824,7 +824,7 @@ public abstract class BtcFormat extends Format {
|
|
|
|
|
* Return a new code-style auto-formatter for the given locale with the given number of
|
|
|
|
|
* fraction places. The returned object will select denominational units based on each
|
|
|
|
|
* value being formatted, and will indicate those units using a currency code, for example,
|
|
|
|
|
* <code>"mBTC"</code>. The returned object will format the fraction-part of numbers using
|
|
|
|
|
* {@code "mBTC"}. The returned object will format the fraction-part of numbers using
|
|
|
|
|
* the given number of decimal places, or fewer as necessary to avoid giving a place to
|
|
|
|
|
* fractional satoshis.
|
|
|
|
|
*/
|
|
|
|
@ -836,7 +836,7 @@ public abstract class BtcFormat extends Format {
|
|
|
|
|
* Return a new code-style auto-formatter for the given locale with the given number of
|
|
|
|
|
* fraction places. The returned object will select denominational units based on each
|
|
|
|
|
* value being formatted, and will indicate those units using a currency code, for example,
|
|
|
|
|
* <code>"mBTC"</code>. The returned object will format the fraction-part of numbers using
|
|
|
|
|
* {@code "mBTC"}. The returned object will format the fraction-part of numbers using
|
|
|
|
|
* the given number of decimal places, or fewer as necessary to avoid giving a place to
|
|
|
|
|
* fractional satoshis.
|
|
|
|
|
*/
|
|
|
|
@ -847,7 +847,7 @@ public abstract class BtcFormat extends Format {
|
|
|
|
|
/**
|
|
|
|
|
* Return a new symbol-style auto-formatter for the given locale. The returned object will
|
|
|
|
|
* select denominational units based on each value being formatted, and will indicate those
|
|
|
|
|
* units using a currency symbol, for example, <code>"µ฿"</code>.
|
|
|
|
|
* units using a currency symbol, for example, {@code "µ฿"}.
|
|
|
|
|
*/
|
|
|
|
|
public static BtcFormat getSymbolInstance(Locale locale) {
|
|
|
|
|
return getInstance(SYMBOL, locale);
|
|
|
|
@ -857,7 +857,7 @@ public abstract class BtcFormat extends Format {
|
|
|
|
|
* Return a new symbol-style auto-formatter for the given locale with the given number of
|
|
|
|
|
* fraction places. The returned object will select denominational units based on each
|
|
|
|
|
* value being formatted, and will indicate those units using a currency symbol, for example,
|
|
|
|
|
* <code>"µ฿"</code>. The returned object will format the fraction-part of numbers using
|
|
|
|
|
* {@code "µ฿"}. The returned object will format the fraction-part of numbers using
|
|
|
|
|
* the given number of decimal places, or fewer as necessary to avoid giving a place to
|
|
|
|
|
* fractional satoshis.
|
|
|
|
|
*/
|
|
|
|
@ -868,7 +868,7 @@ public abstract class BtcFormat extends Format {
|
|
|
|
|
/**
|
|
|
|
|
* Return a new auto-denominating formatter. The returned object will indicate the
|
|
|
|
|
* denominational units of formatted values using either a currency symbol, such as,
|
|
|
|
|
* <code>"฿"</code>, or code, such as <code>"mBTC"</code>, depending on the value of
|
|
|
|
|
* {@code "฿"}, or code, such as {@code "mBTC"}, depending on the value of
|
|
|
|
|
* the argument. Formatting and parsing will be done according to the default locale.
|
|
|
|
|
*/
|
|
|
|
|
public static BtcFormat getInstance(Style style) { return getInstance(style, defaultLocale()); }
|
|
|
|
@ -876,8 +876,8 @@ public abstract class BtcFormat extends Format {
|
|
|
|
|
/**
|
|
|
|
|
* Return a new auto-denominating formatter with the given number of fractional decimal
|
|
|
|
|
* places. The returned object will indicate the denominational units of formatted values
|
|
|
|
|
* using either a currency symbol, such as, <code>"฿"</code>, or code, such as
|
|
|
|
|
* <code>"mBTC"</code>, depending on the value of the first argument. The returned object
|
|
|
|
|
* using either a currency symbol, such as, {@code "฿"}, or code, such as
|
|
|
|
|
* {@code "mBTC"}, depending on the value of the first argument. The returned object
|
|
|
|
|
* will format the fraction-part of numbers using the given number of decimal places, or
|
|
|
|
|
* fewer as necessary to avoid giving a place to fractional satoshis. Formatting and
|
|
|
|
|
* parsing will be done according to the default locale.
|
|
|
|
@ -890,7 +890,7 @@ public abstract class BtcFormat extends Format {
|
|
|
|
|
* Return a new auto-formatter with the given style for the given locale.
|
|
|
|
|
* The returned object that will auto-denominate each formatted value, and
|
|
|
|
|
* will indicate that denomination using either a currency code, such as
|
|
|
|
|
* "<code>BTC</code>", or symbol, such as "<code>฿</code>", depending on the value
|
|
|
|
|
* {@code "BTC"}, or symbol, such as {@code "฿"}, depending on the value
|
|
|
|
|
* of the first argument.
|
|
|
|
|
* <p>The number of fractional decimal places in formatted number will be two, or fewer
|
|
|
|
|
* as necessary to avoid giving a place to fractional satoshis.
|
|
|
|
@ -903,7 +903,7 @@ public abstract class BtcFormat extends Format {
|
|
|
|
|
* Return a new auto-formatter for the given locale with the given number of fraction places.
|
|
|
|
|
* The returned object will automatically-denominate each formatted
|
|
|
|
|
* value, and will indicate that denomination using either a currency code,
|
|
|
|
|
* such as <code>"mBTC"</code>, or symbol, such as "<code>฿</code>",
|
|
|
|
|
* such as {@code "mBTC"}, or symbol, such as {@code "฿"},
|
|
|
|
|
* according to the given style argument. It will format each number
|
|
|
|
|
* according to the given locale.
|
|
|
|
|
*
|
|
|
|
@ -936,7 +936,7 @@ public abstract class BtcFormat extends Format {
|
|
|
|
|
* returned object will format and parse values according to the default locale, and will
|
|
|
|
|
* format the fraction part of numbers with at least two decimal places. The sizes of
|
|
|
|
|
* additional groups of decimal places can be specified by a variable number of
|
|
|
|
|
* <code>int</code> arguments. Each optional decimal-place group will be applied only if
|
|
|
|
|
* {@code int} arguments. Each optional decimal-place group will be applied only if
|
|
|
|
|
* useful for expressing precision, and will be only partially applied if necessary to
|
|
|
|
|
* avoid giving a place to fractional satoshis.
|
|
|
|
|
*/
|
|
|
|
@ -1099,7 +1099,7 @@ public abstract class BtcFormat extends Format {
|
|
|
|
|
* of the shift from coin-denomination in increasingly-precise decimal places. The third
|
|
|
|
|
* parameter is the minimum number of fractional decimal places to use. The third argument
|
|
|
|
|
* specifies the minimum number of fractional decimal places in formatted numbers. The
|
|
|
|
|
* last argument is a <code>List</code> of <code>Integer</code> values, each of which
|
|
|
|
|
* last argument is a {@code List} of {@link Integer} values, each of which
|
|
|
|
|
* specifies the size of an additional group of fractional decimal places to use as
|
|
|
|
|
* necessary to avoid rounding, down to a maximum precision of satoshis.
|
|
|
|
|
*/
|
|
|
|
@ -1131,13 +1131,13 @@ public abstract class BtcFormat extends Format {
|
|
|
|
|
/**
|
|
|
|
|
* Formats a bitcoin value as a number and possibly a units indicator and appends the
|
|
|
|
|
* resulting text to the given string buffer. The type of monetary value argument can be
|
|
|
|
|
* any one of any of the following classes: <code>{@link Coin}</code>,
|
|
|
|
|
* <code>Integer</code>, <code>Long</code>, <code>BigInteger</code>,
|
|
|
|
|
* <code>BigDecimal</code>. Numeric types that can represent only an integer are interpreted
|
|
|
|
|
* as that number of satoshis. The value of a <code>BigDecimal</code> is interpreted as that
|
|
|
|
|
* any one of any of the following classes: {@link Coin},
|
|
|
|
|
* {@link Integer}, {@link Long}, {@link BigInteger},
|
|
|
|
|
* {@link BigDecimal}. Numeric types that can represent only an integer are interpreted
|
|
|
|
|
* as that number of satoshis. The value of a {@link BigDecimal} is interpreted as that
|
|
|
|
|
* number of bitcoins, rounded to the nearest satoshi as necessary.
|
|
|
|
|
*
|
|
|
|
|
* @return the <code>StringBuffer</code> passed in as <code>toAppendTo</code>
|
|
|
|
|
* @return the {@link StringBuffer} passed in as {@code toAppendTo}
|
|
|
|
|
*/
|
|
|
|
|
@Override
|
|
|
|
|
public StringBuffer format(Object qty, StringBuffer toAppendTo, FieldPosition pos) {
|
|
|
|
@ -1146,11 +1146,11 @@ public abstract class BtcFormat extends Format {
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Formats a bitcoin value as a number and possibly a units indicator to a
|
|
|
|
|
* <code>String</code>.The type of monetary value argument can be any one of any of the
|
|
|
|
|
* following classes: <code>{@link Coin}</code>, <code>Integer</code>, <code>Long</code>,
|
|
|
|
|
* <code>BigInteger</code>, <code>BigDecimal</code>. Numeric types that can represent only
|
|
|
|
|
* {@link String}.The type of monetary value argument can be any one of any of the
|
|
|
|
|
* following classes: {@link Coin}, {@link Integer}, {@link Long},
|
|
|
|
|
* {@link BigInteger}, {@link BigDecimal}. Numeric types that can represent only
|
|
|
|
|
* an integer are interpreted as that number of satoshis. The value of a
|
|
|
|
|
* <code>BigDecimal</code> is interpreted as that number of bitcoins, rounded to the
|
|
|
|
|
* {@link BigDecimal} is interpreted as that number of bitcoins, rounded to the
|
|
|
|
|
* nearest satoshi as necessary.
|
|
|
|
|
*
|
|
|
|
|
* @param minDecimals The minimum number of decimal places in the fractional part of the formatted number
|
|
|
|
@ -1164,10 +1164,10 @@ public abstract class BtcFormat extends Format {
|
|
|
|
|
/**
|
|
|
|
|
* Formats a bitcoin value as a number and possibly a units indicator and appends the
|
|
|
|
|
* resulting text to the given string buffer. The type of monetary value argument can be
|
|
|
|
|
* any one of any of the following classes: <code>{@link Coin}</code>,
|
|
|
|
|
* <code>Integer</code>, <code>Long</code>, <code>BigInteger</code>,
|
|
|
|
|
* <code>BigDecimal</code>. Numeric types that can represent only an integer are interpreted
|
|
|
|
|
* as that number of satoshis. The value of a <code>BigDecimal</code> is interpreted as that
|
|
|
|
|
* any one of any of the following classes: {@link Coin},
|
|
|
|
|
* {@link Integer}, {@link Long}, {@link BigInteger},
|
|
|
|
|
* {@link BigDecimal}. Numeric types that can represent only an integer are interpreted
|
|
|
|
|
* as that number of satoshis. The value of a {@link BigDecimal} is interpreted as that
|
|
|
|
|
* number of bitcoins, rounded to the nearest satoshi as necessary.
|
|
|
|
|
*
|
|
|
|
|
* @param minDecimals The minimum number of decimal places in the fractional part of the formatted number
|
|
|
|
@ -1195,7 +1195,7 @@ public abstract class BtcFormat extends Format {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Return the denomination for formatting the given value. The returned <code>int</code>
|
|
|
|
|
* Return the denomination for formatting the given value. The returned {@code int}
|
|
|
|
|
* is the size of the decimal-place shift between the given Bitcoin-value denominated in
|
|
|
|
|
* bitcoins and that same value as formatted. A fixed-denomination formatter will ignore
|
|
|
|
|
* the arguments.
|
|
|
|
@ -1296,7 +1296,7 @@ public abstract class BtcFormat extends Format {
|
|
|
|
|
// ****** PARSING *****
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Parse a <code>String</code> representation of a Bitcoin monetary value. Returns a
|
|
|
|
|
* Parse a {@link String} representation of a Bitcoin monetary value. Returns a
|
|
|
|
|
* {@link org.bitcoinj.core.Coin} object that represents the parsed value.
|
|
|
|
|
* @see java.text.NumberFormat */
|
|
|
|
|
@Override
|
|
|
|
@ -1338,7 +1338,7 @@ public abstract class BtcFormat extends Format {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** Set both the currency symbol and international code of the underlying {@link
|
|
|
|
|
* java.text.NumberFormat} object to the value of the given <code>String</code>.
|
|
|
|
|
* java.text.NumberFormat} object to the value of the given {@link String}.
|
|
|
|
|
* This method is invoked in the process of parsing, not formatting.
|
|
|
|
|
*
|
|
|
|
|
* Only invoke this from code synchronized on the value of the first argument, and don't
|
|
|
|
@ -1383,7 +1383,7 @@ public abstract class BtcFormat extends Format {
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** Parse a <code>String</code> representation of a Bitcoin monetary value. If this
|
|
|
|
|
/** Parse a {@link String} representation of a Bitcoin monetary value. If this
|
|
|
|
|
* object's pattern includes a currency sign, either symbol or code, as by default is true
|
|
|
|
|
* for instances of {@link BtcAutoFormat} and false for instances of {@link
|
|
|
|
|
* BtcFixedFormat}, then denominated (i.e., prefixed) currency signs in the parsed String
|
|
|
|
@ -1437,7 +1437,7 @@ public abstract class BtcFormat extends Format {
|
|
|
|
|
return coin;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** Parse a <code>String</code> representation of a Bitcoin monetary value. If this
|
|
|
|
|
/** Parse a {@link String} representation of a Bitcoin monetary value. If this
|
|
|
|
|
* object's pattern includes a currency sign, either symbol or code, as by default is true
|
|
|
|
|
* for instances of {@link BtcAutoFormat} and false for instances of {@link
|
|
|
|
|
* BtcFixedFormat}, then denominated (i.e., prefixed) currency signs in the parsed String
|
|
|
|
|