SetFieldFormat()
Summary
Changes the way a numeric field is formatted.
Syntax
SetFieldFormat(string field_spec, string field_format)
| Argument | Contents |
|---|---|
| field_spec | A field spec |
| field_format | The new format for the input field; or null to clear a field of its format string |
Notes
-
The format string is used to format the field's numeric values when displayed in an editor. For the details of the formatting, see Format().
-
The change in the format string is propagated to all joined views containing this field. If the input field itself belongs to a joined view, the change is also propagated to any underlying base views.
Example
SetFieldFormat("Employee.Salary", "$,######")
SetFieldFormat("States.PopDensity", "*.000")
Error Codes
| Error Type | Meaning |
|---|---|
| NotFound | The input field does not exist or the field specification is ambiguous |
See Also
| Function | Summary |
|---|---|
| GetFieldFormat() | Returns the format string used to display a numeric field |
| Format() | Formats a number |