xowiki::formfield::numeric instproc json_value (public)

 <instance of xowiki::formfield::numeric[i]> json_value value

Defined in /var/www/openacs/packages/xowiki/tcl/json-procs.tcl

Export a normalized numeric value, or preserve a nonempty string when keep_string_rep is enabled. Empty values are exported as null.

Parameters:
value (required)
Stored numeric field value.
Returns:
Two-element ns_json type/payload pair.

Testcases:
No testcase defined.
Source code:
# Stored numeric values are already normalized. keep_string_rep explicitly
# requests preservation of the original (possibly localized) string.
if {${:keep_string_rep} && $value ne ""} {
  return [list string $value]
}
return [::xowiki::json_scalar number $value]
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: