Jump to content

AtkNumberAttribute: Difference between revisions

From NusaATK
New page: {{attribute}} === Description === The atkNumberAttribute is used to represent number values. === Params === The constructor of the atkCurrencyAttribute has the following params: atkNu...
 
 
(One intermediate revision by the same user not shown)
Line 5: Line 5:


=== Params ===
=== Params ===
The constructor of the atkCurrencyAttribute has the following params:
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 as US Dollars, and has a precsion of 5 decimal places. The flags hide it from the list view,
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

Attribute: atkNumberAttribute

API docs | Flags

List of other attributes

atkNumberAttribute screenshot

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)