Type:
For any types t where Readable t(Text) -> t
Converts a value from text.
This function works for any readable type (the only non-readable types are function
types). If the intended type cannot be inferred automatically, you may need to use
the from text to(..) function to specify the type .
Some notes for specific types:
- For boolean values, lower-case and upper-case are allowed in the names.
- Dates are read using a variety of formats. Be careful with the DD-MM-YY formats and
similar as they are ambiguous against MM-DD-YY. If this is an issue, use the date
from string function to specify a format.
- Numbers must use dot as the decimal separator, commas are not supported.
- If you want to get a Text out of from text, it must be in quotes.
from text("65") > 64→true
from text("TRUE") | false→true
as type(type{Date}, from text("21 March 2004"))→date from ymd(2004{year}, 3{month}, 21{day})
as type(type{[(a: Boolean, b: Number{m})]}, from text("[(a:True, b:0), (a:FALSE, b:-1.6)]"))→[(a:true, b:0{m}), (a:false, b:-1.6{m})]