AtkNumberAttribute: Difference between revisions
Appearance
Rwolverine (talk | contribs) New page: {{attribute}} === Description === The atkNumberAttribute is used to represent number values. === Params === The constructor of the atkCurrencyAttribute has the following params: atkNu... |
Rwolverine (talk | contribs) |
||
| (One intermediate revision by the same user not shown) | |||
| Line 5: | Line 5: | ||
=== Params === | === Params === | ||
The constructor of the | The constructor of the atkNumberAttribute has the following params: | ||
atkNumberAttribute($name, $flags=0, $size=10, $decimals=0) | atkNumberAttribute($name, $flags=0, $size=10, $decimals=0) | ||
| Line 15: | Line 15: | ||
;Size (optional) int | ;Size (optional) int | ||
;decimals (optional) int Number of decimals to show. | ;decimals (optional) int Number of decimals to show. | ||
=== Examples === | === Examples === | ||
(in a [[node]] constructor): | (in a [[node]] constructor): | ||
| Line 21: | Line 22: | ||
$this->add(new atkNumberAttribute("quantity", AF_OBLIGATORY, 14, 4)); | $this->add(new atkNumberAttribute("quantity", AF_OBLIGATORY, 14, 4)); | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Adds a field 'pieceprice' to the node that displays | Adds a field 'pieceprice' to the node that displays 14 integer places, and has a precsion of 4 decimal places. | ||
[[Category:Attributes]] | [[Category:Attributes]] | ||
--[[User:Rwolverine|Rwolverine]] 19:54, 6 December 2007 (CET) | --[[User:Rwolverine|Rwolverine]] 19:54, 6 December 2007 (CET) | ||
Latest revision as of 16:14, 29 February 2008

Description
The atkNumberAttribute is used to represent number values.
Params
The constructor of the atkNumberAttribute has the following params:
atkNumberAttribute($name, $flags=0, $size=10, $decimals=0)
- name String
- Name of the attribute (unique within a node, and for most attributes, corresponds to a field in the database.
- flags (optional) int
- Flags for the attribute. For more information about flags, please checkout the flags section.
- Size (optional) int
- decimals (optional) int Number of decimals to show.
Examples
(in a node constructor):
$this->add(new atkNumberAttribute("quantity", AF_OBLIGATORY, 14, 4));
Adds a field 'pieceprice' to the node that displays 14 integer places, and has a precsion of 4 decimal places.
--Rwolverine 19:54, 6 December 2007 (CET)