Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Anomalia segnalazione Hd formato errato per il cambio
- Loading branch information
rpucciarelli
committed
Dec 21, 2012
1 parent
87f1642
commit 946de83
Showing
10 changed files
with
47 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
sigla-ejb/src/main/java/it/cnr/contab/util/Importo4CifreFormat.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package it.cnr.contab.util; | ||
/** | ||
* Formattatore di importi a 4 cifre decimali | ||
*/ | ||
|
||
public class Importo4CifreFormat extends GenericImportoFormat { | ||
public final static java.text.Format format = new java.text.DecimalFormat("#,##0.0000"); | ||
|
||
public Importo4CifreFormat() { | ||
super(); | ||
setPrecision(4); | ||
} | ||
|
||
public java.text.Format getFormat() { | ||
return format; | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
sigla-ejb/src/main/java/it/cnr/contab/util/Importo4CifrePositivoFormat.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package it.cnr.contab.util; | ||
/** | ||
* Formattatore di importi a 4 cifre decimali positivi | ||
*/ | ||
|
||
public class Importo4CifrePositivoFormat extends Importo4CifreFormat { | ||
public Importo4CifrePositivoFormat() { | ||
super(); | ||
} | ||
|
||
public Object parseObject(String source) throws java.text.ParseException{ | ||
|
||
Object obj = super.parseObject(source); | ||
if (obj != null && obj instanceof java.math.BigDecimal) { | ||
java.math.BigDecimal bd = (java.math.BigDecimal)obj; | ||
if (bd.signum() < 0) | ||
throw new it.cnr.jada.bulk.ValidationParseException("sono ammessi solo valori positivi!", 0); | ||
} | ||
return obj; | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters