1. Sivaprakash BKR
  2. PowerBuilder
  3. Monday, 25 February 2019 06:14 AM UTC

Hello,

Using PB 2017 SP3 Build 1880

[in a computed column in a datawindow]

I need to display a computed column with amount in Indian Format [ ##,##,##,##0.00 ]   (See the comma).  When I create the expression as 

namecolumn + ' (' + String(groupbalance, '##,##,##,##0.00') + ')'

what I get is Income (987,654,321.90) instead of Income (98,76,54,321.90).  

Anything should I do to display it correctly ?

Happiness Always
BKR Sivaprakash

 

Roland Smith Accepted Answer Pending Moderation
  1. Thursday, 28 February 2019 13:49 PM UTC
  2. PowerBuilder
  3. # 1

You only need '#,##0.00' the rest of the number will follow the pattern automatically.

Is the result a decimal value? Applying a decimal format to a whole number would lead to unexpected results.

 

Comment
  1. Sivaprakash BKR
  2. Friday, 1 March 2019 04:21 AM UTC
Roland Smith,

Indian format is somehow different from international format. We have to separate 3 columns on right most side, then with 2 digits when moving towards left.

eg. 12,34,56,789.99



which will not work out with the format you suggested.
  1. Helpful
There are no comments made yet.
Kevin Ridley Accepted Answer Pending Moderation
  1. Thursday, 28 February 2019 12:44 PM UTC
  2. PowerBuilder
  3. # 2

I think this is probably a bug.  I simplified it to - string(groupbalance_1, '##,##,##,##,##,##,##0.00') and it still didn't work.  You didn't have any non decimal numbers, so I tried it in one of my dw's with a regular non decimal number and it worked fine.  I then took it even a step further and tried - string(truncate(groupbalance_1, 2), '##,##,##,##,##,##,##0.00').  This displayed the correct format as well, so PB is somehow struggling with the decimals in the String function.  I would enter a new bug and see what support says.

 

https://www.appeon.com/standardsupport/search

Comment
  1. Kevin Ridley
  2. Thursday, 7 March 2019 12:53 PM UTC
I think I like my workaround better, lol. Well at least they are looking into it.
  1. Helpful
  1. Chris Pollach @Appeon
  2. Thursday, 7 March 2019 17:44 PM UTC
FYI: This issue is reproducible from older PB versions as well (ie: 11.x and 12.x).
  1. Helpful
  1. Sivaprakash BKR
  2. Friday, 8 March 2019 07:48 AM UTC
Yes Kevin, for me both are good. Adding extra strings in format makes the dw to behave correctly.

Yes Chris, it's legacy bug.
  1. Helpful
There are no comments made yet.
Sivaprakash BKR Accepted Answer Pending Moderation
  1. Thursday, 28 February 2019 04:59 AM UTC
  2. PowerBuilder
  3. # 3

Thanks Chris.

OS: Win 7 Ultimate Service Pack 1
PB: 2017 SP 3 build 1880

Here are attached image files of my regional settings and the output [ preview ] of the datawindow.

Tried

Changed to English [ United States ] from English [ India ] under Formats in Region and Settings.  Restarted Powerbuilder, no change.

This issue is only when I try to display data in a datawindow's computed column.   Using the same command [ string(numericfield, '##,##,##,##0.00') ] in window gives me the correct result.   Setting formats in datawindow's numeric columns also gives me the correct result.   Only place where this doesn't work is in a datawindow's computed column. 

Any change do I need to do in Regional Settings ?

Happiness Always
BKR Sivaprakash

 

Attachments (4)
Comment
  1. Sivaprakash BKR
  2. Saturday, 2 March 2019 04:51 AM UTC
Thanks Chris,

I could test in PB 11.5 where Indian format is not supported. Could not test in 12.x. [ Don't have a copy ]

If Display/Edit mask are handled by PBDWExxx.dll, it seems it's working right.



Again the issue is with String command used in a computed column inside a datawindow.

Would like to know whether string commands, at window level and in datawindow level, are handled by different dll in any way or by the same dll?
  1. Helpful
  1. Sivaprakash BKR
  2. Saturday, 2 March 2019 04:53 AM UTC
As Kevin told that he'll be raising a bug report with Appeon support, I'm not doing the same.
  1. Helpful
  1. Chris Pollach @Appeon
  2. Wednesday, 6 March 2019 20:19 PM UTC
Yes, I suspect that this issue was prevalent through all the v11.x and 12.x series of PB's.
  1. Helpful
There are no comments made yet.
Sivaprakash BKR Accepted Answer Pending Moderation
  1. Wednesday, 27 February 2019 07:42 AM UTC
  2. PowerBuilder
  3. # 4

Thanks Kevin, 

I've attached a PB project with a datawindow [ with data ] named dw_rep_profitloss_tform_old.  Just preview it and see data displayed under Expenditure and Income columns.

Amount column displays correctly, but not computed columns.

would like to know the mistake I do ?

Happiness Always
BKR Sivaprakash

NB.:  Attached project in rar file.  Need to unzip it.

Attachments (1)
Comment
There are no comments made yet.
Kevin Ridley Accepted Answer Pending Moderation
  1. Monday, 25 February 2019 15:30 PM UTC
  2. PowerBuilder
  3. # 5

You shouldn't need to make it into a string.  Create a computed column where the value is your numeric column, then under Format just use ##,##,##,##0.00 and it should work like you want. 

 

Kevin

Comment
  1. Kevin Ridley
  2. Tuesday, 26 February 2019 14:16 PM UTC
FYI - In my test, column1 is a string column and column2 is a standard numeric. What are you getting currently with what you have?
  1. Helpful
  1. Chris Pollach @Appeon
  2. Wednesday, 27 February 2019 21:23 PM UTC
Hi Kevin;

I suspect that Sivaprakash's display mask issues are related to his App user's "Regional Settings" and no specific localized PB run-time files for that language. If that is the case. maybe the best solution is to build a Global Function that processes these unique "display/Edit" masks the way the App user's want it?

Regards ... Chris
  1. Helpful
  1. Kevin Ridley
  2. Thursday, 28 February 2019 12:54 PM UTC
@Chris - please see my most recent reply. It seems like it's isolated to the String function converting a decimal. If I use a regular long type number, it works fine, or when truncate() the decimal to eliminate the decimal places, the display format shows correctly.
  1. Helpful
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.
We use cookies which are necessary for the proper functioning of our websites. We also use cookies to analyze our traffic, improve your experience and provide social media features. If you continue to use this site, you consent to our use of cookies.