mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 04:57:00 -04:00
Add type_name function to query the type of a value
This commit is contained in:
@@ -11,6 +11,7 @@ These functions are built into the program, other [[type:function]]s can be defi
|
||||
| [[fun:to_color]] Convert any value to a [[type:color]]
|
||||
| [[fun:to_image]] Convert any value to an [[type:image]]
|
||||
| [[fun:to_date]] Convert any value to a [[type:date]]
|
||||
| [[fun:type_name]] Get the type of a value
|
||||
|
||||
! Numbers <<<
|
||||
| [[fun:abs]] Absolute value
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
Function: type_name
|
||||
|
||||
DOC_MSE_VERSION: since 2.0.2
|
||||
|
||||
--Usage--
|
||||
> type_name(any_value)
|
||||
|
||||
Return the type of the given value as a string.
|
||||
Note that type names are localized, so they should not be compared to a fixed string.
|
||||
|
||||
--Parameters--
|
||||
! Parameter Type Description
|
||||
| @input@ ''any type'' Value to determine the type of.
|
||||
|
||||
--Examples--
|
||||
> type_name("hello") == "string"
|
||||
> type_name(1) == "integer number"
|
||||
Reference in New Issue
Block a user