tracylee
7th September 2015, 05:45
Hi,

I have a problem to display data in the report. I use the free.mem() and alloc.mem() function to read and keep the data. When display the data is string. So, how can I change it to integer/floating on my report?

Example:
category Amount
A 200.00
B 500.50
C 120.40

I want the amount to be numeric but now is display as string. How can I change to numeric? Please advice. Thanks.

bhushanchanda
7th September 2015, 10:07
Hi,

1. Declare a double variable and assign the value of the string variable to it using val() function

e.g. domain tcamnt amnt_val
string amnt_str

amnt_str = "182.22"
if not isspace(amnt_str) then
amnt_val = val(amnt_str)
else
amnt_val = 0
endif

2. On your report layout, use val(amnt_str) and use domain like tc amnt

tracylee
8th September 2015, 03:25
Hi,

1. Declare a double variable and assign the value of the string variable to it using val() function

e.g. domain tcamnt amnt_val
string amnt_str

amnt_str = "182.22"
if not isspace(amnt_str) then
amnt_val = val(amnt_str)
else
amnt_val = 0
endif

2. On your report layout, use val(amnt_str) and use domain like tc amnt

Hi, thanks for your help. My problem solved. Thanks a lots.