Jump to content

AtkCurrencyAttribute: Difference between revisions

From NusaATK
No edit summary
 
No edit summary
Line 1: Line 1:
atkCurrencyAttribute atkCurrencyAttribute (string $name, [int $flags = 0], [int $size = 10], [string $currencysymbol = ""], [int $decimals = 2], [string $decimalseparator = ""], [string $thousandsseparator = ""])
=== Description ===
The atkCurrancyAttribute is used to represent currancy values.


Example:
=== Params ===
$this->add(new atkCurrencyAttribute("pieceprice", AF_HIDE_LIST|AF_FORCE_LOAD, 12, "$", 5));
The constructor of the atkCurrencyAttribute has the following params:
atkCurrencyAttribute (string $name, [int $flags = 0], [int $size = 10], [string $currencysymbol = ""], [int $decimals = 2], [string $decimalseparator = ""], [string $thousandsseparator = ""])  


this sets a field pieceprice to use 5 decimal places and show $ for US Dollars, it does not show up in the list view and the field loads when accessing it via node calls.
* 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
The max. number of characters that can be entered. If not specified, or set to 0, the max. size is automatically
retrieved from the table metadata.
*currencysymbol (optional) mixed
The symbol of currancy for your location
* decimals (optional) int
The number of decimal places
* decimalseperator (optional) mixed
if you use a character other than "." for yoru decimal place you can change it here
*thousandsseperator (optional) mixed
if allows you to set a thousands operator usually ","
 
=== Examples ===
(in a [[node]] constructor):
 
$this->add(new atkCurrencyAttribute("pieceprice"", AF_HIDE_LIST|AF_FORCE_LOAD, 12, "$", 5));
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,
 
 
[[Category:Attributes]]


--[[User:Rwolverine|Rwolverine]] 19:54, 6 December 2007 (CET)
--[[User:Rwolverine|Rwolverine]] 19:54, 6 December 2007 (CET)

Revision as of 19:02, 6 December 2007

Description

The atkCurrancyAttribute is used to represent currancy values.

Params

The constructor of the atkCurrencyAttribute has the following params: atkCurrencyAttribute (string $name, [int $flags = 0], [int $size = 10], [string $currencysymbol = ""], [int $decimals = 2], [string $decimalseparator = ""], [string $thousandsseparator = ""])

  • 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
The max. number of characters that can be entered. If not specified, or set to 0, the max. size is automatically 
retrieved from the table metadata.
  • currencysymbol (optional) mixed
The symbol of currancy for your location
  • decimals (optional) int
The number of decimal places
  • decimalseperator (optional) mixed
if you use a character other than "." for yoru decimal place you can change it here
  • thousandsseperator (optional) mixed
if allows you to set a thousands operator usually ","

Examples

(in a node constructor):

$this->add(new atkCurrencyAttribute("pieceprice"", AF_HIDE_LIST|AF_FORCE_LOAD, 12, "$", 5));

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,

--Rwolverine 19:54, 6 December 2007 (CET)