Tagged Questions
0
votes
1answer
25 views
How to convert numbers in string to another unit
Im trying to simply take this string and convert it to something. In my example im trying to convert some numbers that are returned from JSON, i want to convert those numbers from 12,345 to 123.45. ...
0
votes
0answers
13 views
Integer into actual name [duplicate]
Can't really think of how to explain this question in the title.
Basically, if I have the number, (7 for this example), is there a way to write that as a string, but to the actual number, like "seven" ...
0
votes
1answer
9 views
convert Decimal Number of a string into int using Integer.valueOf() java
As theres some decimal numbers in my text file, but the Integer.valueOf() is not working for decimal numbers, is there any other ways that i can convert this string into int?
3
votes
3answers
59 views
Making sure no integers in a string?
I have a simple question. I'm just wanting to know how I would have my program read the "input()" and see if there are integers or any kind of number in the string, and if so then print out a message ...
0
votes
5answers
40 views
method to validate that amount should be of type integer return type
I am getting an amount in an object through the getter method of pojo
but that amount getter method return type is set as string in pojo
as shown below
//setting need to be done in pojo
private ...
0
votes
2answers
66 views
String to Int conversion in python
If I have a string "2+3", is there anyway to convert it to an integer so it comes out as 5?
I tried this:
string = 2+3
answer = int(string)
But I get an error:
ValueError: invalid literal for ...
0
votes
4answers
89 views
Java read integer from middle of the string
Is it possible in Java to efficiently read an integer from random position of the string? For instance, I have a
String s = "(34";
if (s.charAt(0) == '(')
{
// How to read a number from position ...
-2
votes
5answers
62 views
Remove n chars from end of String [closed]
Can I somehow remove n chars from the end of a String ?
In example:
String a = "Hello";
a -= 1;
With the result being a = "Hell" ?
0
votes
1answer
58 views
C++ atoi grabs values of other characters created in same portion of program
I am trying to read a string of 9 characters into 9 integer values, to be stored in an array (for now I store them in 9 separate ints, will put them in the array once they read in OK). General ...
0
votes
1answer
29 views
How do I convert from Integer Queue to String?
OK, so I have this very simple, very inefficient program, but that's alright, the only thing that I would like to know is how to print the first five numbers of the queue as zeros without changing the ...
0
votes
6answers
33 views
Dummy values of serialized variable
Why default values as Zero are displayed for transient variables in Java?
How does it know that the value should be 0 for integer and null for String?
0
votes
4answers
102 views
Concatenate String and IO Integer in Haskell
I wrote a function returning the current screen width as IO Integer (working so far).
getScreenWidth:: IO Integer
getScreenWidth = do
(sx, sy, w, h) <- getScreenDim 0
...
4
votes
3answers
148 views
How to check std::string if its indeed an integer?
The following code converts an std::string to int and the problem lies with the fact that it cannot discern from a true integer or just a random string. Is there a systematic method for dealing with ...
0
votes
1answer
39 views
convert a ruby string or integer or float into a javascript or jquery one
in my rails project some of the following code I have in a Google map is:
function initialize_google_maps() {
var currentlatlng = new google.maps.LatLng(<%= @user.lat %>, <%= @user.lng ...
0
votes
8answers
61 views
Reverse string of integers while not reversing the integers themselves
I'm trying to make a function reverse a string of integers, but am only able to mirror it completely, with the following piece of code I found. (I want to translate it from string to string without ...