FieldBigDecimal.java 1.15 KB
Newer Older
TongZuu committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
package com.csc.library.database;

import java.math.BigDecimal;

/**
 * @author Administrator
 *
 * To change this generated comment edit the template variable "typecomment":
 * Window>Preferences>Java>Templates.
 * To enable and disable the creation of type comments go to
 * Window>Preferences>Java>Code Generation.
 */
public class FieldBigDecimal extends FieldDouble {

	public FieldBigDecimal(String name, int width, int decimal, String description) {
		super(name, width, decimal, description);
		this.setDefault("0");
		this.setDefault();
		this._DEFAULT_DEFAULTVALUE="0";
	}

	public FieldBigDecimal(String name, Integer width, Integer decimal, String description) {
		this(name, width.intValue(), decimal.intValue(), description);

	}

    /*
	public boolean set(String x) {
		if (x.trim().length() == 0) {
			return this.set(0);
		} else if (x.indexOf(".") == -1) {
			return this.set(new BigDecimal(x));
		} else {
			return this.set(new BigDecimal(x));
		}
	}
   */ 
    
	public String getSaveString() {
		if(this.isEncrypt())
			return this.encryption();
		else	
			return  String.valueOf(this.getBigDecimal());
	}	

}