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

display decimals in smartforms

Former Member
0 Likes
6,404

Hello All,

I want to display a weight field in a smartform. when the value is 2.10 it shows the proper value but if the value is 2.00 it shows the value as 2. How can I display the value with decimals.

Please help.

Thanks,

Anju

Hello All,

I want to display a weight field in a smartform. when the value is 2.10 it shows the proper value but if the value is 2.00 it shows the value as 2. How can I display the value with decimals.

Please help.

Thanks,

Anju

11 REPLIES 11
Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
3,610

Check if there are any formatting option associated with the text element ?

If not, i think there must be some coding which is removing the decimals in case of zero decimal value.

Check & then revert back.

BR,

Suhas

Read only

Former Member
0 Likes
3,610

Hello Suhas,

There is no coding which is removing the values from the data. The value is displayed as 2.00 just before the value is printed but not displayed in the form.

Thanks,

Anju

Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
3,610

>

> There is no coding which is removing the values from the data.

So we rule out one possibility. Are there any formatting options associated with the text element ?

Read only

Former Member
0 Likes
3,610

Hi,

I have not provided any formatting options for the text element.

Thanks,

Anju

Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
3,610

>

> I have not provided any formatting options for the text element.

What is the definition of the field you are using to display the text-element ?

Read only

Former Member
0 Likes
3,610

Hi,

Whts the type of the field u r displaying in the smartform?

if u r using other types just use the correct type for tht.

so it will automatically adjusted according to that.

With Regards,

Sumodh.P

Read only

Former Member
0 Likes
3,610

Try passing the current itab-value to a Global variable inside the smartform:

create global variable:

*variable type P decimals 2

so in the window's text you can pass the current value to the global variable so it displays the 2 decimals places.

global_value = curr_value

hope it helps.

Read only

Former Member
0 Likes
3,610

for smartforms, use the format:

&field(<10.2)&

means your field value, with 10 positions, and two decimals....

hope it helps

Read only

Former Member
0 Likes
3,610

Hello,

If I try using p(.3) It gives me an error "incorrect formatting".

Thanks,

Anju

Read only

0 Likes
3,610

Hi,

If you want to display 2 decimal places in smartforms then use

&fieldname(.2)&

Regads,

Chintan Shah

Read only

Former Member
0 Likes
3,610

k