Hi everyone,
We have a textbox with a value bound to a program field.
The data type is decimal and the length is 7 with 2 decimals. Field Formatting = Number.
1. If the value of this field is zero or 0.00 we would like to display blank (or nothing).
2. If the value of this field is 0.42 we would like to display 0.42.
If we take the default values, the zero value is not displayed which is correct but the 0.42 value is displayed as .42
If we change the edit word to ' 0 . ' the 0.42 value is displayed as 0.42 wich is correct but the zero value is also displayed with 0.00 (here should be a blank).
If we go to keywords and type in EDTCDE(4) we cannot compile the dds source. Error CPD7554 keyword for current data type or keyboard shift not valid occurs. The field format is 7S 2H.
In the classic green screen dds sources we defined the format type Y for the numeric field and used the EDTCDE(4) which worked correctly.
According to the profound documentation, EDTCDE is supported. How can we use the EDTCDE keyword with visual designer?
If EDTCDE is not usable, how can we solve this issue?
Is it possible to use another textbox setting to achieve our goal?
Thank you very much for your answer in advance.
Christoph
Edit Decimal Values with Visual Designer
-
- Profound User
- Posts: 53
- Joined: Tue Jan 27, 2015 8:13 am
- First Name: Christoph
- Last Name: Seitz
- Company Name: Waser + Co. AG
- Phone: +41 44 94 74 341
- Address 1: Erlenwiesenstrasse 2
- City: Volketswil
- State / Province: Outside Canada/USA
- Zip / Postal Code: 8604
- Country: Switzerland
- Contact:
Edit Decimal Values with Visual Designer
Last edited by chs on Thu Mar 24, 2016 7:49 am, edited 1 time in total.
-
- New User
- Posts: 3
- Joined: Thu Oct 09, 2014 7:09 am
- First Name: Thomas
- Last Name: Möller
- Company Name: Ecclesia GmbH
- Country: Germany
- Contact:
Re: Edit Decimal Values with Visual Designer
Hi Christoph,
in preview mode it works as you desired, if you set edit mask to '0.'
Greetings
Thomas
in preview mode it works as you desired, if you set edit mask to '0.'
Greetings
Thomas
-
- Experienced User
- Posts: 2711
- Joined: Wed Aug 01, 2012 8:58 am
- First Name: Scott
- Last Name: Klement
- Company Name: Profound Logic
- City: Milwaukee
- State / Province: Wisconsin
Re: Edit Decimal Values with Visual Designer
Christoph,
When I use EDTCDE(4) in a green-screen application, it does not show a leading zero. With EDTCDE(4), it shows up as .42 (to use your example).
If I specify CHGJOB DECFMT(J), it adds a leading zero, but uses a comma for a decimal separator, so you get 0,42 -- that is the only way that I can find to make it show a leading zero in green-screen. (Aside from using an edit word, but as you point out, an edit word will not show blanks when the value is zero.)
In a Rich Display with the formatting set to defaults in the binding dialog (i.e. show zero balance is unchecked, edit word is left blank) it works exactly the same way. With CHGJOB DECFMT(J), it uses a comma as a decimal place, and uses a leading zero, so I get 0,42. With other decimal formats, it does not show the leading zero (exactly the same as green-screen.)
Adding the EDTCDE keyword in a Rich Display will not help, as the Rich Display uses it's formatting dialog, it does not use the DDS keywords for formatting unless you are using it in green-screen mode. But, since the formatting matches the EDTCDE behavior, there is no reason to want to change this.
It is possible to write your own custom formatting routine. If you do that, you can make it format any way you wish. Here's the documentation for that feature:
http://www.profoundlogic.com/docs/displ ... +Formatter
When I use EDTCDE(4) in a green-screen application, it does not show a leading zero. With EDTCDE(4), it shows up as .42 (to use your example).
If I specify CHGJOB DECFMT(J), it adds a leading zero, but uses a comma for a decimal separator, so you get 0,42 -- that is the only way that I can find to make it show a leading zero in green-screen. (Aside from using an edit word, but as you point out, an edit word will not show blanks when the value is zero.)
In a Rich Display with the formatting set to defaults in the binding dialog (i.e. show zero balance is unchecked, edit word is left blank) it works exactly the same way. With CHGJOB DECFMT(J), it uses a comma as a decimal place, and uses a leading zero, so I get 0,42. With other decimal formats, it does not show the leading zero (exactly the same as green-screen.)
Adding the EDTCDE keyword in a Rich Display will not help, as the Rich Display uses it's formatting dialog, it does not use the DDS keywords for formatting unless you are using it in green-screen mode. But, since the formatting matches the EDTCDE behavior, there is no reason to want to change this.
It is possible to write your own custom formatting routine. If you do that, you can make it format any way you wish. Here's the documentation for that feature:
http://www.profoundlogic.com/docs/displ ... +Formatter
Who is online
Users browsing this forum: No registered users and 1 guest