package org.verapdf.model.impl.pb.cos;

import org.apache.pdfbox.cos.COSNumber;
import org.verapdf.model.coslayer.CosNumber;

import java.math.BigDecimal;

/**
 * Created by Evgeniy Muravitskiy on 4/27/15.
 * <p>
 *     Current class is representation of CosNumber interface of abstract model.
 *     Methods of this class using in PBCosInteger and PBCosReal.
 *     This class is analogue of COSNumber in pdfbox.
 * </p>
 *
 * @see PBCosInteger
 * @see PBCosReal
 */
public abstract class PBCosNumber extends PBCosObject implements CosNumber {

    protected PBCosNumber(COSNumber number) {
        super(number);
    }

    /** Get the string representing this object
     */
    @Override
    public String getstringValue() {
        return String.valueOf(((COSNumber) baseObject).doubleValue());
    }

    /** Get truncated integer value
     */
    @Override
    public Long getintValue() {
        return ((COSNumber) baseObject).longValue();
    }

    /** Get original decimal value
     */
    @Override
    public Double getrealValue() {
        return ((COSNumber) baseObject).doubleValue();
    }
}

@@ -152,72 +152,47 @@
 al;%0A
-%0A/**%0A * Created by Evgeniy Muravitskiy on 4/27/15.%0A * %3Cp%3E%0A *    
+import java.text.DecimalFormat;%0A%0A/**%0A *
  Cur
@@ -264,20 +264,16 @@
 odel.%0A *
-    
  Methods
@@ -326,20 +326,16 @@
 Real.%0A *
-    
  This cl
@@ -380,16 +380,39 @@
 .%0A *
- %3C/p%3E%0A *
+%0A * @author Evgeniy Muravitskiy
 %0A * 
@@ -1044,52 +1044,137 @@
     
-return ((COSNumber) baseObject).doubleValue(
+String value = new DecimalFormat(%22#.#######%22).format(((COSNumber) baseObject).doubleValue());%0A        return Double.valueOf(value
 );%0A 

Add support of short double for PBCosNumber