Jump to content

Int field

From EPrints Documentation


Description[edit]

This metadata field is for store whole number values. Such as the number of pages of a publication or number of pieces that make up an exhibition-type publication. Maximum number that can be stored is 2,147,483,647, minimum number is -2,147,483,647.

Inheritance[edit]

Additional Properties[edit]

Name Default Value Required Description Notes
digits 9 NO The maximum number of digits for the integer value. The default value for this property is taken from cfg.d/field_property_defaults.pl. Analogous to maxlength. Database INT(11) cannot reliably store numbers that takes up more than 9 digits (including a sign if negative).

Required Phrases[edit]

No additional phrases beyond standard metadata field phrases.

Database[edit]

Int fields are stored in the database as

fieldname INT(11)

API[edit]

See API page.

Examples[edit]

Most basic example.

{
    name => 'num_pieces',
    type => 'int',
},

Limit input field to six characters (digits) and do not create a SQL database table index.

{
    name => 'pages',
    type => 'int',
    maxlength => 6,
    sql_index => 0,
},