1. Sanjoy Saha
  2. PowerBuilder
  3. Monday, 7 September 2020 10:34 AM UTC

Hi All,

In PB2017 I have set the edit mask property of a decimal field as ###.00 in my data object. Also I have set the format as ###.00 for that field in the data object. But when some value such as 461.50 is coming for that field , somehow it is getting rounded off and instead of displaying 461.50 , 462 is getting displayed. Please help me in resolving the issue. I want to display the exact 461.50 decimal value.

John Fauss Accepted Answer Pending Moderation
  1. Tuesday, 8 September 2020 14:28 PM UTC
  2. PowerBuilder
  3. # 1

Greetings, Sanjoy -

1) What release and build of PB 2017 are you using?

2) What DBMS (vendor, version) does your app connect to?

3) What PB database driver and connection parameters (SQLCA.DBMS = ??? and SQLCA.DBParm = ???) Please show us the actual connection values being used (obscure any sensitive/security-related values, of course).

4) Can you export the DataWindow and post it here so that we can examine it? If not, can you reproduce the issue in a test DataWindow, then export that?

5) Does this issue occur when running the compiled application exe or from the PB IDE, or both? Is the application being built/deployed as 32-bit or 64-bit?

Comment
There are no comments made yet.
Sanjoy Saha Accepted Answer Pending Moderation
  1. Monday, 7 September 2020 18:42 PM UTC
  2. PowerBuilder
  3. # 2

No other functions like round () is being used. I also have some other decimal fields in that screen with edit mask $#,###,##0.00. For those fields it is working fine. But for fields with edit mask ###.00 I am facing the problem.

Comment
There are no comments made yet.
Sanjoy Saha Accepted Answer Pending Moderation
  1. Monday, 7 September 2020 18:38 PM UTC
  2. PowerBuilder
  3. # 3

Yes David, in column specification the type is Decimal 2 only.

Comment
There are no comments made yet.
Sanjoy Saha Accepted Answer Pending Moderation
  1. Monday, 7 September 2020 18:37 PM UTC
  2. PowerBuilder
  3. # 4

Yes I have Decimal 2 as data type only.

Comment
There are no comments made yet.
Olan Knight Accepted Answer Pending Moderation
  1. Monday, 7 September 2020 15:58 PM UTC
  2. PowerBuilder
  3. # 5

In the "is it plugged  in" category:

Look at the data field itself, the one being displayed.
Check the number of decimal places and ensure that you a) HAVE decimal places in the field, and  b) that you have exactly 2 decimal places being displayed.


Olan

 

Comment
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Monday, 7 September 2020 14:52 PM UTC
  2. PowerBuilder
  3. # 6

Hi Sanjoy;

  PB truncates on EditMasks & Display formats behaviour is to truncate. Check for other code like the Round() command that might be being used.

Regards ... Chris

Comment
There are no comments made yet.
David Peace (Powersoft) Accepted Answer Pending Moderation
  1. Monday, 7 September 2020 14:04 PM UTC
  2. PowerBuilder
  3. # 7

Hi Sanjoy

Your edit mask is correct so something else is affecting the rounding, can you confirm that you column specifications are Decimal 2?

Cheers

David

Comment
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.