- Home /
Unity Convert more int to one float or String and back?
For Example :
var a int = 5;
var b int = 1;
var c int = 3;
var abcfloat : float/String;
abcfloat = a","b","c;
and back: a int get the first number b the seconds and c the third
Answer by Joyrider · Aug 13, 2013 at 08:56 AM
Google is your best friend !!
Yes, I don't know the code in javascript, but it certainly is possible. it is a language-related thing, not specifically Unity-related.
But from a simple search on google I found :
string > float : resultingFloat = parseFloat(yourString)
float > string : resultingString = yourFloat.toString(); or even just : resultingString = yourFloat+"";
same goes for int, but than use parseInt(yourString)
If you have a string with several numbers, you'll first need to split them up with myString.**Split()**
Your answer
Follow this Question
Related Questions
GUI.Label shows volume from a slider 3 Answers
Convert Text to float 3 Answers
Can I create a list with an int/float and a string? C# 2 Answers
Cannot convert 'callable(int) as float' to 'float'. 1 Answer
c# convert int to string 2 Answers