SMTPClient & REAL
- How-to
-
FABRIZIO VISCARDI
- PowerBuilder
- Wednesday, 10 September 2025 12:17 PM UTC
I am using SMTPClient to send email from my application and it works well. But I noticed something strange and unusual in a calculus with real values.
I am using Powerbuilder 2022R3 Build 3391 / 64 bits.
I set a real variable 'lr_imp1' with 6.339:
lr_imp1 = 6.339
I convert the real 'lr_imp1' into the string 'ls_imp1', with a mask:
ls_imp1 = string ( lr_imp1, "#,##0.00" )
I convert such string into a real variable 'lr_imp1_from_string' :
lr_imp1_from_string = REAL ( ls_imp1 )
The first time, BEFORE sending mail with SMTP Client, the value of lr_imp1_from_string is 6,3400000152.... that is OK.
After I send an emal with SMTPClient
I repeat the same assignements like before in different variables.
I set a real variable 'lr_imp2' with 6.339:
lr_imp2 = 6.339
I convert the real 'lr_imp2' into the string 'ls_imp2', with a mask:
ls_imp2 = string ( lr_imp2, "#,##0.00" )
I convert such string into a real variable 'lr_imp2_from_string' :
lr_imp2_from_string = REAL ( ls_imp2 )
Now the value of 'lr_imp2_from_string' is 6. It has lost decimal figures.
Someone has an idea about this ?
Find Questions by Tag
Helpful?
If a reply or comment is helpful for you, please don’t hesitate to click the Helpful button. This action is further confirmation of their invaluable contribution to the Appeon Community.