org.efaps.number2words
Interface IConverter

All Known Implementing Classes:
AbstractDecimalConverter, English, German, Spanish

public interface IConverter

Interface description which must be implement for a language to convert numbers to related text representation.

Version:
$Id: IConverter.java 2699 2009-06-27 12:58:51Z tim.moxter $
Author:
The eFaps Team

Method Summary
 java.lang.String convert(long _number)
          Converts the _number into the related text representation.
 boolean isDecimal()
          Returns true in the case the converter from numbers to words uses the decimal system.
 boolean usesShortScale()
          Returns true in the case the converter for a language uses the short scale for the decimal system.
 

Method Detail

convert

java.lang.String convert(long _number)
Converts the _number into the related text representation.

Parameters:
_number - number to convert
Returns:
converted number

isDecimal

boolean isDecimal()
Returns true in the case the converter from numbers to words uses the decimal system. E.g. the converter for German language is using the decimal system, otherwise the converter for Roman Numbers is NOT using the decimal system (and returns then false).

Returns:
true if the converter of the used language uses decimal system; otherwise false

usesShortScale

boolean usesShortScale()

Returns true in the case the converter for a language uses the short scale for the decimal system.

If the language uses the decimal system (isDecimal()), two different numerical systems "large scale" and "short scale" exists. Sometimes used numerical system may also changed in the history for one language. E.g. in the United Kindom before the second world war they used the large scale system. In 1974 the UK government changed to short scale for their statistics. Another example is the French language. They changed after the second world war from short scale to long scale.

In 1948 the 9th General Conference on Weights and Measures proposed the universal use of the long scale. So here this means that the usage of short scale is an specialty, but could be checked with this method.

The different between this two numerical systems is, that a billion in short scale is not the same that in the long scale. The following table gives an overview:

ValueShort ScaleLong Scale
100oneone
103thousandthousand
106millionmillion
109billionthousand million (sometimes milliard)
1012trillionbillion
1015quadrillionthousand billion (sometimes billiard)
1018quintilliontrillion

For a deeper explanation see e.g. the description of the short and long scale in the Wikipedia.

Returns:
true if the converter uses short scale
See Also:
isDecimal()


Copyright © 2009 eFaps. All Rights Reserved.