02-11-2011 3:33 PM
Hi,
We are using now a function to convert a float number to a string. Now, we are using function module C14W_NUMBER_CHAR_CONVERSION but this function doesnu2019t take into account the decimal notation defined in the user parameter. For example if we have decimal notation Y 1 234 567,89 a float number 1.2345666666660000E+03 is converted as 1234,567 instead as 1 234,567 with a blank space.
Does anybody know how to convert in a proper way?
Regards,
Joan B. Altadill
02-15-2011 6:08 AM
Hi Joan,
You can try one more thing with WRITE command, as below.
Var1 (Float value)
Var2 (String)
WRITE Var1 to Var2.
Now the Var1 will be converted automatically to Var2 as per user's settings of decimals.
if this doesn't work then 1st convert your float value to packed value then to string.
Hope this helps.
02-11-2011 4:37 PM
Hi Joan,
There are two ways to go about this:
1) You can go to your user Settings and modify the decimal notation specific to your profile.
2) Otherwise, you can first convert your float to a simple character format, replace all fullstops with commas and viceversa, and then make the actual conversion.
Let me know if you need the actual code for this.
Cheers,
Shailesh.
02-14-2011 8:59 AM
Hi,
We have the user with the appropiate parameter but the function C14W_NUMBER_CHAR_CONVERSION doesn't take into account. The number appears without any separator (only the decimal part is shown using ,). This is the problem, the first option you propose simply does not work.
The second option is not valid because our layouts are used for users with different formats and in such case we have to develop any case in a different way.
Do you know another option?
Regards,
Joan
02-14-2011 9:21 AM
Hello,
I agree with the first option : changing the user-setting (change the format of the decimal).
If you change the user-setting make sure that you deconnect from the system and reconnect to test the modification.
02-15-2011 6:08 AM
Hi Joan,
You can try one more thing with WRITE command, as below.
Var1 (Float value)
Var2 (String)
WRITE Var1 to Var2.
Now the Var1 will be converted automatically to Var2 as per user's settings of decimals.
if this doesn't work then 1st convert your float value to packed value then to string.
Hope this helps.