That's interesting! Dimuthu,
I think you asked the same question on SO? I posted a comment there [1]: "I think what you got is correct. JavaScript has the Number type only for numerical values. Usually you shouldn't print numbers directly. Ideally a number should be formatted before printing. i.e. You should print only after you have a string representation of the number." Could you please let us know the version of Jaggery you are trying? or the WSO2 Application Server version? [1] http://stackoverflow.com/questions/21659188/wso2-jaggery-how-to-parse-a-number-into-an-integer#comment32738181_21659188 On Sun, Feb 9, 2014 at 9:01 PM, Harsha Thirimanna <[email protected]> wrote: > Hi Dimuhtu, > > Are you sure about this ? > > I just tried that in http://jaggeryjs.org/ "Try It Now". There is no > such an issue. > > > *Harsha Thirimanna* > Senior Software Engineer; WSO2, Inc.; http://wso2.com > * <http://www.apache.org/>* > * email: **[email protected]* <[email protected]>* cell: +94 71 5186770* > * twitter: **http://twitter.com/ <http://twitter.com/afkham_azeez>* > *harshathirimann linked-in: **http: > <http://lk.linkedin.com/in/afkhamazeez>**//www.linkedin.com/pub/harsha-thirimanna/10/ab8/122 > <http://www.linkedin.com/pub/harsha-thirimanna/10/ab8/122>* > > *Lean . Enterprise . Middleware* > > > > On Sun, Feb 9, 2014 at 7:00 PM, Dimuthu Upeksha <[email protected]> wrote: > >> Fixed. It was not a problem with parseInt method. It was a problem with >> print() operation in jaggery. Even if I run "print(1)" it prints "1.0". >> Easy fix is to enter print(i+"") instead print(i) which converts the >> integer into a string. >> >> Thanks >> Dimuthu >> >> >> On Sun, Feb 9, 2014 at 5:23 PM, Dimuthu Upeksha <[email protected]>wrote: >> >>> Hi all, >>> In this simple jaggery code >>> >>> for(var i=0;i<10;i++){ >>> >>> print(i); >>> >>> print("<br/>"); >>> >>> } >>> >>> Output was like >>> >>> 0.0 >>> >>> 1.0 >>> >>> .... >>> >>> I need to parse these outputs into integer. I tried parseInt(i) method >>> but it also gave the same result. What could be the reason for that? >>> >>> Thanks >>> >>> Dimuthu >>> >>> -- >>> Dimuthu Upeksha >>> Engineering Intern >>> WSO2 inc. >>> >> >> >> >> -- >> Dimuthu Upeksha >> Engineering Intern >> WSO2 inc. >> >> _______________________________________________ >> Dev mailing list >> [email protected] >> http://wso2.org/cgi-bin/mailman/listinfo/dev >> >> > > _______________________________________________ > Dev mailing list > [email protected] > http://wso2.org/cgi-bin/mailman/listinfo/dev > > -- Isuru Perera Senior Software Engineer | WSO2, Inc. | http://wso2.com/ Lean . Enterprise . Middleware about.me/chrishantha
_______________________________________________ Dev mailing list [email protected] http://wso2.org/cgi-bin/mailman/listinfo/dev
