Convert Text to float

How can I convert a string text?

for example from “250$” to 250

or from “-210$” to -210

or from “-87.44$” to -87.44

I need to get the float to do some calculations.

You can use float.Parse( string s ) to convert to a float or if you don’t know if the string is definitely a number then you can use float.TryParse( string s, out float result ) which returns true if it can convert.
Not sure if is works if there is a $ at the end but i think it should

You could try

float number = Single.Parse(value);

using System;

float number = Single.Parse("-87.44");
Debug.Log(number);

returns:
-87.44

If you want to remove symbols from the end like $ you should remove them by using
Remove.String(Int32) ← Int32 = the number of characters to remove from the end.

myTempString = “250"; myTempString = myTempString.Replace("”, “”);