Jump to content
We've recently updated our Privacy Statement, available here ×

siti141283

Members
  • Posts

    6
  • Joined

  • Last visited

siti141283's Achievements

Rookie

Rookie (2/14)

  • Week One Done
  • One Month Later
  • One Year In
  • First Post Rare
  • Conversation Starter Rare

Recent Badges

0

Reputation

  1. Hi all, Finally i'm able to solve the problem. Instead of using $V{A}.intValue() and $V{B}.intValue() for the calculation, i use $V{A}.doubleValue() and $V{B}.doubleValue(), and it works perfectly for all my textfields.
  2. Hi all, Finally i'm able to solve the problem. Instead of using $V{A}.intValue() and $V{B}.intValue() for the calculation, i use $V{A}.doubleValue() and $V{B}.doubleValue(), and it works perfectly for all my textfields. ;)
  3. Hi all.. Thanks Nick.. :) I've tried something similar to the code u gave me, that is : new Double(($V{B}.intValue() == 0) ? 0.00 : ($V{A}.intValue() / $V{B}.intValue() * 100)) $V{A} and $V{B} is integer type, so that i cast it to double. That code works perfectly for some of my textfields. But somehow i dont know why it didn't work for some other textfields, somehow it display 0.00 even both variables is not null. Does anyone have any idea why it didn't work? to check if my code is correct or not, i try to use something like : new Double(($V{B}.intValue() == 0) ? 1.00 : 2.00), the value for $V{B} is 316, so when i run it, it display 2.00. So i know it can confirm that the code is correct. It's only when i put the calculation, it'll display 0.00 again. I have similar textfields to display the percentage, but it is for variables with double data type. The code i use is : new Double(($V{C}.doubleValue() == 0.00) ? 0.00 : ($V{D}.doubleValue() / $V{C}.doubleValue() * 100)). That code works fine with all the textfields. Can anyone help me to figure out why is this happening?
  4. Hi all.. Thanks to svenn.. :) I've tried something similar to the code u gave me, that is : new Double(($V{B}.intValue() == 0) ? 0.00 : ($V{A}.intValue() / $V{B}.intValue() * 100)) $V{A} and $V{B} is integer type, so that i cast it to double. That code works perfectly for some of my textfields. But somehow i dont know why it didn't work for some other textfields, somehow it display 0.00 even both variables is not null. Does anyone have any idea why it didn't work? to check if my code is correct or not, i try to use something like : new Double(($V{B}.intValue() == 0) ? 1.00 : 2.00), the value for $V{B} is 316, so when i run it, it display 2.00. So i know it can confirm that the code is correct. It's only when i put the calculation, it'll display 0.00 again. I have similar textfields to display the percentage, but it is for variables with double data type. The code i use is : new Double(($V{C}.doubleValue() == 0.00) ? 0.00 : ($V{D}.doubleValue() / $V{C}.doubleValue() * 100)). That code works fine with all the textfields. Can anyone help me to figure out why is this happening?
  5. Hi, I have a problem where i need to calculate percentage. I use this syntax to calculate the percentage, $V{A}/$V{B} * 100. The problem occur if $V{B} is 0. Anyone, please advise me how to solve this problem. can i do any kind of checking like if..else statement? Thanks in advance...
  6. Hi, I have a problem where i need to calculate percentage. I use this syntax to calculate the percentage, $V{A}/$V{B} * 100. The problem occur if $V{B} is 0. Anyone, please advise me how to solve this problem. can i do any kind of checking like if..else statement? Thanks in advance... :unsure:
×
×
  • Create New...