Sponsored Content
Top Forums Shell Programming and Scripting Convert string number to a integer Post 302990510 by RudiC on Friday 27th of January 2017 11:11:55 AM
Old 01-27-2017
What if it were "one thousand and one"? And, which strange application / program would give an output like the quoted?

I recall to have seen an string - number converter in these fora some time (a year?) ago - try a search.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

convert from an integer to a string

i want to convert from an integer to a string..in unix...i am writing a C program with embedded SQL... I remeber using itoa...but for some reason it doesnt work......i cant find it in the manual..... Maybe that is the wrong command..... but i have checked Dev Studio.....and it doest exist in the... (6 Replies)
Discussion started by: mojomonkeyhelper
6 Replies

2. Shell Programming and Scripting

counting non integer number in awk

Hi, I am having the following number in the file tmp 31013.004 20675.336 43318.190 30512.926 48992.559 277893.111 41831.330 8749.113 415980.576 28273.054 I want to add these numbers, I am using following script awk 'END{print s}{s += $1}' tmp its giving answer 947239 which is correct,... (3 Replies)
Discussion started by: chaitubek
3 Replies

3. Shell Programming and Scripting

how to convert string to an integer and how to do calculations like add.,sub.,mult. on it

How to convert string into an integer or number For example : % set tim = `date` % echo $tim Tue Feb 22 16:25:08 IST 2011 here How to increment time by 10 hrs like 16+10 , here 16 is a string in date cmd. .. how to convert 16 to an integer and added to a another nimber ? Thanks... (3 Replies)
Discussion started by: sbhamidi
3 Replies

4. Shell Programming and Scripting

Read Variable From Fille And Convert it to Integer

I read 3 variables from from Inputfile.txt the third one "startnumber" is a number when i compare it with 9 ($startnumber -le 9) it give's me a "unary operator expected", i know that -le is for number comparison. What i need is to convert $startnumber to integer (i have try to do it with expr but... (8 Replies)
Discussion started by: marios
8 Replies

5. Shell Programming and Scripting

Convert to Integer

Hi fellows!! i'm doing something which is not working out for me properly which i don't understand why nowdate=`date +%s` echo $nowdate now the problem how to convert a date which is stored in a variable mydate="22/Oct/2011" mydate=`date -d '$mydate' +%s` it gives error... (11 Replies)
Discussion started by: me_newbie
11 Replies

6. Shell Programming and Scripting

how to compare string integer with an integer?

hi, how to I do this? i="4.000" if ; then echo "smaller" fi how do I convert the "4.000" to 4? Thanks! (4 Replies)
Discussion started by: h0ujun
4 Replies

7. Shell Programming and Scripting

[Solved] need to convert decimal to integer

Using below command awk 'NR==FNR{A=$1;next} {sum+=($2*A)}END{OFMT="%20f";print int(sum)}' Market.txt Product.txt answer:351770174.00000 how to convert this to 351770174. when i try with below command i am getting different result. awk 'NR==FNR{A=$1;next}... (3 Replies)
Discussion started by: katakamvivek
3 Replies

8. Shell Programming and Scripting

How to convert string into integer in shell scripting?

Hi All, sessionid_remote=$(echo "select odb_sessionid from sysopendb where odb_dbname='syscdr';" | sudo -u cucluster ssh ucbu-aricent-vm93 "source /opt/cisco/connection/lib/connection.profile; $INFORMIXDIR/bin/dbaccess sysmaster@ciscounity") for sid in $sessionid_remote;do if * ]];... (2 Replies)
Discussion started by: deeptis
2 Replies

9. Shell Programming and Scripting

How to read from file and convert from string to integer?

Hi all, I am trying to write a script to be able to Run top command Pick the PIDs that are taking more than 90% of CPU time Get more details like what is the script name and location for that PID Script should run until I manually kill it by ctrl + C I have come up with following script... (3 Replies)
Discussion started by: pat_pramod
3 Replies

10. Shell Programming and Scripting

Convert a String to a Number

I read in two numbers from a user but the number is a string. #!/bin/bash read -p "Enter first number: " num1 read -p "Enter second number: " num2 I know you can use the the "expr" or "bc" command to automatically convert the string to a number then add them together. But I don't want to add... (10 Replies)
Discussion started by: Loc
10 Replies
XtAppSetTypeConverter(3)					   XT FUNCTIONS 					  XtAppSetTypeConverter(3)

NAME
XtAppSetTypeConverter, XtSetTypeConverter - register resource converter SYNTAX
void XtAppSetTypeConverter(XtAppContext app_context, String from_type, String to_type, XtConverter converter, XtConvertArgList con- vert_args, Cardinal num_args, XtCacheType cache_type, XtDestructor destructor); void XtSetTypeConverter(String from_type, String to_type, XtConverter converter, XtConvertArgList convert_args, Cardinal num_args, XtCa- cheType cache_type, XtDestructor destructor); ARGUMENTS
app_context Specifies the application context. converter Specifies the type converter procedure. convert_args Specifies how to compute the additional arguments to the converter or NULL. from_type Specifies the source type. num_args Specifies the number of additional arguments to the converter or zero. to_type Specifies the destination type. cache_type Specifies whether or not resources produced by this converter are sharable or display-specific and when they should be freed. destructor Specifies a destroy procedure for resources produced by this conversion, or NULL if no additional action is required to deallo- cate resources produced by the converter. DESCRIPTION
XtSetTypeConverter registers the specified type converter and destructor in all application contexts created by the calling process, including any future application contexts that may be created. XtAppSetTypeConverter registers the specified type converter in the single application context specified. If the same from_type and to_type are specified in multiple calls to either function, the most recent over- rides the previous ones. SEE ALSO
X Toolkit Intrinsics - C Language Interface Xlib - C Language X Interface X Version 11 libXt 1.1.3 XtAppSetTypeConverter(3)
All times are GMT -4. The time now is 11:13 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy