Topic
  • 4 replies
  • Latest Post - ‏2013-01-09T06:26:43Z by SystemAdmin
SystemAdmin
SystemAdmin
658 Posts

Pinned topic NumbertoString

‏2013-01-08T12:39:04Z |
Could someone please explain with an example NumbertoString function.I am still very confused about its usage.Thanks in advance
Updated on 2013-01-09T06:26:43Z at 2013-01-09T06:26:43Z by SystemAdmin
  • Rizwan.Kaif
    Rizwan.Kaif
    197 Posts

    Re: NumbertoString

    ‏2013-01-08T15:13:57Z  
    NumberToString() is used to convert the value of a Number type variable to a string. There are many situations in which we need to do this.

    Sometimes we need to concatenate a number with a string. For example Product ID with the Product Names where the Product ID is Number type and Product Name is String type. In this case we need to convert the Number type to String.
    
    vID = 123; vName = 
    'Apple'; vFullName = NumberToString(vID) | vName;
    


    Also when you are doing the ASCIIOUTPUT() you are required to convert all the numbers to string so that you can output them to file.
    
    ASCIIOUTPUT( vFileName, NumberToString(vID) , vName , vFullName);
    


    Hope that helps!
    Rizwan Kaif
  • SystemAdmin
    SystemAdmin
    658 Posts

    Re: NumbertoString

    ‏2013-01-08T15:32:35Z  
    NumberToString() is used to convert the value of a Number type variable to a string. There are many situations in which we need to do this.

    Sometimes we need to concatenate a number with a string. For example Product ID with the Product Names where the Product ID is Number type and Product Name is String type. In this case we need to convert the Number type to String.
    <pre class="jive-pre"> vID = 123; vName = 'Apple'; vFullName = NumberToString(vID) | vName; </pre>

    Also when you are doing the ASCIIOUTPUT() you are required to convert all the numbers to string so that you can output them to file.
    <pre class="jive-pre"> ASCIIOUTPUT( vFileName, NumberToString(vID) , vName , vFullName); </pre>

    Hope that helps!
    Rizwan Kaif
    Thanks a lot for your reply ,Rizwan.So it means it literally converts the number in to the format vID=123 to vID='123'please confirm.Thanks
  • Rizwan.Kaif
    Rizwan.Kaif
    197 Posts

    Re: NumbertoString

    ‏2013-01-08T15:43:38Z  
    Thanks a lot for your reply ,Rizwan.So it means it literally converts the number in to the format vID=123 to vID='123'please confirm.Thanks
    Yes it will convert the number 123 to a string '123'

    As a best practice, I would keep the numbers and strings into separate variables.

    Cheers!
    Rizwan Kaif
  • SystemAdmin
    SystemAdmin
    658 Posts

    Re: NumbertoString

    ‏2013-01-09T06:26:43Z  
    Yes it will convert the number 123 to a string '123'

    As a best practice, I would keep the numbers and strings into separate variables.

    Cheers!
    Rizwan Kaif
    Thanks a lot.