Month: August 2015

Missing zeros while using function str2int()


In most cases, while we are converting str2int() we will be missing ‘0’s.

In my case, i have purchId(“00010”) which i need to insert into container but after insert we see its been changes to “10”, in these case we can use “strRFix()” function to get back original value.

sample code:
purchIdContainer = str2con(purchId);

//get length of the purch id and use the function strRFix()

purchIdStr = strRFix(conPeek(purchIdContainer,1),strlen(purchId),’0′);

Hope this help!!!.