Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Riina Antikainen
/
Moya
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 831114ff
authored
Dec 14, 2014
by
Tuomas Riihimäki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix paytrail > 1000 and decimal rounding bugs
1 parent
c8104aa8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
code/moya-beans/ejbModule/fi/codecrew/moya/beanutil/DecimalXMLAdapter.java
code/moya-beans/ejbModule/fi/codecrew/moya/beanutil/DecimalXMLAdapter.java
View file @
831114f
...
@@ -19,6 +19,7 @@
...
@@ -19,6 +19,7 @@
package
fi
.
codecrew
.
moya
.
beanutil
;
package
fi
.
codecrew
.
moya
.
beanutil
;
import
java.math.BigDecimal
;
import
java.math.BigDecimal
;
import
java.math.RoundingMode
;
import
java.text.NumberFormat
;
import
java.text.NumberFormat
;
import
java.util.Locale
;
import
java.util.Locale
;
...
@@ -28,8 +29,9 @@ public class DecimalXMLAdapter extends XmlAdapter<String, BigDecimal> {
...
@@ -28,8 +29,9 @@ public class DecimalXMLAdapter extends XmlAdapter<String, BigDecimal> {
@Override
@Override
public
String
marshal
(
BigDecimal
v
)
throws
Exception
{
public
String
marshal
(
BigDecimal
v
)
throws
Exception
{
NumberFormat
format
=
NumberFormat
.
getNumberInstance
(
new
Locale
(
"en"
,
"US"
));
return
format
.
format
(
v
);
v
=
v
.
setScale
(
2
,
RoundingMode
.
UP
);
return
v
.
toString
();
}
}
@Override
@Override
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment