
Anonymous
Not applicable
2013-08-29
10:28 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
How to Convert BigDecimal to String
Hi Members,
We have faced the issue to Convert the BigDecimal to String while execute the Job. can anyone provide the solution?
Regards,
Venkateswarlu.
We have faced the issue to Convert the BigDecimal to String while execute the Job. can anyone provide the solution?
Regards,
Venkateswarlu.
1,625 Views
2 Replies

Anonymous
Not applicable
2013-08-29
10:57 AM
Author
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
hi,
apply toString() to your BigDecimal .
see java doc for BG : http://docs.oracle.com/javase/6/docs/api/java/math/BigDecimal.html
that give you 3 different methods to convert BG to String
regards
laurent
apply toString() to your BigDecimal .
/* example in a tJava*/
BigDecimal bg = new BigDecimal(0.12235645,new java.math.MathContext (8)); //precision 8
System.out.println(bg.toString());
Starting job bigd at 16:00 29/08/2013.
connecting to socket on port 4042
connected
0.12235645
disconnected
Job bigd ended at 16:00 29/08/2013.
see java doc for BG : http://docs.oracle.com/javase/6/docs/api/java/math/BigDecimal.html
that give you 3 different methods to convert BG to String
regards
laurent
1,625 Views

Specialist
2013-09-01
09:08 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
For numbers smaller than 0.00001, .toString() gives you exponential notation i.e. 1E-6. Use .toPlainString() instead.
1,625 Views
