org.apache.poi.hssf.contrib.view
Class SVFractionalFormat
java.lang.Object
java.text.Format
org.apache.poi.hssf.contrib.view.SVFractionalFormat
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Cloneable
public class SVFractionalFormat
- extends java.text.Format
This class is used to format cells into their fractional format.
I cant be 100% sure that the same fractional value will be displayed as in
excel but then again it is a lossy formating mode anyway
- Since:
- 15 July 2002
- Author:
- Jason Height
- See Also:
- Serialized Form
Nested classes/interfaces inherited from class java.text.Format |
java.text.Format.Field |
Constructor Summary |
SVFractionalFormat(java.lang.String formatStr)
Constructs a new FractionalFormatter
The formatStr defines how the number will be formatted
# ?/? Up to one digit
# ??/?? Up to two digits
# ???/??? Up to three digits
# ?/2 In halves
# ?/4 In quarters
# ?/8 In eighths
# ?/16 In sixteenths
# ?/10 In tenths
# ?/100 In hundredths |
Method Summary |
java.lang.Object |
clone()
|
java.lang.String |
format(double val)
|
java.lang.StringBuffer |
format(java.lang.Object obj,
java.lang.StringBuffer toAppendTo,
java.text.FieldPosition pos)
|
java.lang.Object |
parseObject(java.lang.String source)
|
java.lang.Object |
parseObject(java.lang.String source,
java.text.ParsePosition status)
|
Methods inherited from class java.text.Format |
format, formatToCharacterIterator |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SVFractionalFormat
public SVFractionalFormat(java.lang.String formatStr)
- Constructs a new FractionalFormatter
The formatStr defines how the number will be formatted
# ?/? Up to one digit
# ??/?? Up to two digits
# ???/??? Up to three digits
# ?/2 In halves
# ?/4 In quarters
# ?/8 In eighths
# ?/16 In sixteenths
# ?/10 In tenths
# ?/100 In hundredths
format
public final java.lang.String format(double val)
format
public java.lang.StringBuffer format(java.lang.Object obj,
java.lang.StringBuffer toAppendTo,
java.text.FieldPosition pos)
- Specified by:
format
in class java.text.Format
parseObject
public java.lang.Object parseObject(java.lang.String source,
java.text.ParsePosition status)
- Specified by:
parseObject
in class java.text.Format
parseObject
public java.lang.Object parseObject(java.lang.String source)
throws java.text.ParseException
- Overrides:
parseObject
in class java.text.Format
- Throws:
java.text.ParseException
clone
public java.lang.Object clone()
- Overrides:
clone
in class java.text.Format
Copyright 2008 The Apache Software Foundation or
its licensors, as applicable.