ludic/docs/language/text/text-to_float.md
Orkuncakilkaya c57eafcacc feat(text): Text.to_float; a void function's return <value> is an error
Text.to_float reads a leading decimal number (strtod), the twin of Text.to_int, for data files.
A return with a value in a function that returns nothing now says so where it is, instead of
reaching clang as 'store void'. Seed regenerated.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-23 19:19:28 +03:00

827 B

id name category kind tokens sig tip order ns member
text-to_float Text.to_float text namespace-method Text.to_float Text.to_float(s) -> float Parse a leading decimal number from a string. 11 Text to_float

Reads an optional sign, the leading digits, a decimal point and an exponent from s and returns them as a float, stopping at the first character that cannot continue a number - so Text.to_float("0.25 m") is 0.25. A string with no leading number yields 0.0. It is the float twin of Text.to_int, for reading a data file or a typed value.

Parameters:

  • s — the string to parse
program ParseSpeed {
  var typed: string = "3.2"

  handler Apply phase Update {
    let speed = Text.to_float(typed)   # 3.2
  }
}