Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Decimals in Smartforms

Former Member
0 Likes
1,866

Hi all.

I have some variables on a smartform, but the decimals are specified dynamically on a table, for instance, the table tells me that a fields must be printed with 2 decimals, other field with 4 decimals, and so on.

How can I print those fields with dynamic decimals??

Thanx

Jesus

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,143

Hi,

have different variables with all kinds of decimal points (like var1 with decimals 2, var2 with decimals 4 etc). Fill the field value in any one of these variables depending upon your condition & display the same with a condition (use 'conditions' tab).

7 REPLIES 7
Read only

Former Member
0 Likes
1,143

&itab-field1(.2)&------->two decimal

&itab-field2(.4)&------>four decimal.

Read only

0 Likes
1,143

Hi Kishan.

Thank you for your answer, but that would work if I know the decimals..... the thing is that they are specified dynamically, so I would need to do something like &itab-field1(.N)&, where N is the number of decimals.

I tried this on the smartform, but it is not allowed.

Jesus

Read only

Former Member
0 Likes
1,143

try

&itab1-field(C.2)&

raj

Read only

Former Member
0 Likes
1,144

Hi,

have different variables with all kinds of decimal points (like var1 with decimals 2, var2 with decimals 4 etc). Fill the field value in any one of these variables depending upon your condition & display the same with a condition (use 'conditions' tab).

Read only

0 Likes
1,143

hi jesus,

as kishan told... you can explicitily give the Decimal number like &v_numb(.2)& or

&v_numb(.4)&...

how many decimal V_numb contains? and there should on condition to print 2 dicmals or 4 decimals...

wht i suggest you is create two textelments... on is withe (.4) and another one with (.2)... then in Condition tab of the textelemten give the condtion..

If you want more clear info... plese expliain on which condtion you want that

<b>Please Close this thread.. when u r problem ise solved</b>

Reward if Helpful

Regards

Naresh Reddy K

Read only

0 Likes
1,143

Hi All.

The thing is that the decimla numbers are configured on a table, there could be many different values, not just 2 and 4, that was just an example.

What I need to do is the equivalent of

<b>WRITE var1 DECIMALS var_dec</b>

where var_dec has the number of decimals that come from the table.

Thanx

Jesus

Read only

0 Likes
1,143

if it is the case the values will be printed as it is... still yopu face any problem..

you do on thing ... before printing the value create program lines <b>move the Value to cahracter format Varialble..</b> so that you can print.. as you want..

Message was edited by:

Naresh Reddy