Janek Kowalski

Greenhorn
+ Follow
since Jun 06, 2009
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Janek Kowalski

Rob Prime wrote:I would prefer Till's solution. It handles cases like the jump form 99.xx to 100 better.



I've chosen Till's solution because using this I create one object less (MathContext) but when I've changed rounding mode to HALF_UP in yours solution it worked pretty the same. (99.7 was converted to 100 properly). Perhaps I'm missing something.

greetings
j.k.
14 years ago
Thank you very much .

Both solutions work fine.

greetings
j.k.
14 years ago
Hello Everybody,

I have problem with converting BigDecimal value to long value but with rounding applied (HALF_UP). i.e:
I have BigDecimal:



After covering I'd like l to have value 13, so method longValue doesn't help.
I use following trick but I'm not happy about it, maybe there is better way to do this?



greetings
j.k.

14 years ago