If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Unix Shell Scripts > How do I convert a character to a numeric value ?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-09-08, 22:36
gauravjain21 gauravjain21 is offline
Registered User
 
Join Date: Mar 2005
Posts: 41
How do I convert a character to a numeric value ?

How do I convert 0000002 to a 2 or a numeric value / integer
Reply With Quote
  #2 (permalink)  
Old 01-10-08, 07:01
radoulov radoulov is offline
Registered User
 
Join Date: May 2007
Location: Milano, Italy
Posts: 22
Code:
printf "%d\n" 0000002
Reply With Quote
  #3 (permalink)  
Old 01-10-08, 08:26
stolze stolze is offline
Registered User
 
Join Date: Jan 2007
Location: Jena, Germany
Posts: 2,662
Do some mathematical calculations like adding 0:
Code:
echo $[0000002 + 0]
__________________
Knut Stolze
IBM DB2 Analytics Accelerator
IBM Germany Research & Development
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On