This language bar is your friend. Select your favorite languages!

Idiom #146 Convert string to floating point number

Extract floating point value f from its string representation s

import locale
s = u'545,2222'
locale.setlocale(locale.LC_ALL, 'de')
f = locale.atof(s)
f = float(s)
import std.conv;
float f =!float;
f = num.parse(s);
import "strconv"
f, err := strconv.ParseFloat(s, 64)
read s :: Double
f := StrToFloat(s);
uses sysutils;
f := s.ToExtended;
f = s.to_f
let f = s.parse::<f32>().unwrap();

Do you know the best way to do this in your language ?
New implementation...

Idiom created by

Related idioms