This page is also available in 3 other languages

toFloat()

[스트링개체 함수]

설명

타당한 스르링을 float 으로 변환. The input String should start with a digit. If the String contains non-digit characters, the function will stop performing the conversion. For example, the Strings "123.45", "123", and "123fish" are converted to 123.45, 123.00, and 123.00 respectively. Note that "123.456" is approximated with 123.46. Note too that floats have only 6-7 decimal digits of precision and that longer Strings might be truncated.

문법

myString.toFloat()

매개변수

myString: a variable of type String

반환

float

스트링이 숫자로 시작하지 않으면, 0이 반환됨.

더보기