Hello All,
I have dynamiclaly genearted 12 values as below usingthe code:
set global task_value to ""
repeat 12 times
put format("%.2f",random(0,20000)/1000) into genrated_task_value
replace "." with "," in genrated_task_value
insert genrated_task_value into global task_value
end repeat
log "Genrated_task_value:"&&global task_value
Values:
[“16,82”,“19,58”,“3,41”,“0,32”,“15,17”,“15,70”,“2,31”,“17,34”,“10,26”,“0,01”,“7,36”,“19,30”]
Now entered this value into repestive text boxes & stored in the DB.
After BD query the ouptut as below:
[{demand01:“16.82”, demand02:“19.58”, demand03:“3.41”, demand04:“.32”, demand05:“15.17”, demand06:“15.70”, demand07:“2.31”, demand08:“17.34”, demand09:“10.26”, demand10:“.01”, demand11:“7.36”, demand12:“19.30”, TaskName:“EAA_task_name_1”}]
Now have I comapred both values as below. Eventhough both output looks same. but It’s fail.
put ["16,82","19,58","3,41","0,32","15,17","15,70","2,31","17,34","10,26","0,01","7,36","19,30"] into genrated_value
put [{demand01:"16.82", demand02:"19.58", demand03:"3.41", demand04:".32", demand05:"15.17", demand06:"15.70", demand07:"2.31", demand08:"17.34", demand09:"10.26", demand10:".01", demand11:"7.36", demand12:"19.30", TaskName:"EAA_task_name_1"}] into db_task_value
repeat with each item of db_task_value
put the values of it into raw_task_value
end repeat
log "Raw_task_value:"&raw_task_value
replace "." with "," in raw_task_value
log "Raw_task_value with comma:"&raw_task_value
log "Genrated value:"&genrated_value
if genrated_value begins with raw_task_value
log "matched"
else
log "not matched"
end if
O/p:
Raw_task_value:[“16.82”,“19.58”,“3.41”,“.32”,“15.17”,“15.70”,“2.31”,“17.34”,“10.26”,“.01”,“7.36”,“19.30”,“EAA_task_name_1”]
2/22/23, 8:03:49 AM Log Raw_task_value with comma:[“16,82”,“19,58”,“3,41”,“,32”,“15,17”,“15,70”,“2,31”,“17,34”,“10,26”,“,01”,“7,36”,“19,30”,“EAA_task_name_1”]
2/22/23, 8:03:49 AM Log Genrated value:[“16,82”,“19,58”,“3,41”,“0,32”,“15,17”,“15,70”,“2,31”,“17,34”,“10,26”,“0,01”,“7,36”,“19,30”]
2/22/23, 8:03:49 AM Log not matched
Could you pls help, How to compare the entered value with DB value?