on 07-14-2008 10:39 AM
Dear Gurus.
I need to display dinamic decimal places in my form.
for example if I have a variable containing value:
1.500 - need to display it as 1.5 (omitting trailling zeroes)
1.520 - need to display it as 1.52,
1.000 - need to display it as 1
please help.
Thanks & Regards,
William Prawira.
Hi,
Check this:
SHIFT w_test RIGHT DELETING TRAILING '0'.
Regards
Adil
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Dear Ram and Adil,
Thanks for your answers,
both ways are able to solve my problem, but seems like Adil's is more suitable for this case.
a little correction :
SHIFT - RIGHT DELETING TRAILING must be followed by variable , so we need to insert '0' into a variable which must be declared before.
Data: v1(1) value '0'.
SHIFT w_test RIGHT DELETING TRAILING v1.
Thanks & Regards,
William Prawira.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
you need to write program lines in order to check the first,second and thrid decimal places with the following code and then display accrodingly the values.
LV_DEC_PART = FRAC( TABLE-FIELD ).
then in insert three text nodes with the same field with offsets.
&TABLE-FIELD.0& with the condition LV_DEC_PART+0(1) = 0.
&TABLE-FIELD.1& with the condition LV_DEC_PART0(2) = 0 AND LV_DEC_PART0(1) # 0.
&TABLE-FIELD.2& with the condition LV_DEC_PART0(3) = 0 AND LV_DEC_PART0(1) # 0 AND LV_DEC_PART+0(2) # 0.
Hope this is clear.
Regards,
Ram
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
24 | |
11 | |
9 | |
7 | |
6 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.