Cybo Advanced Field EngineCyboweb Technologies · Documentation · v1.0.2

Number field

Purpose

A number: a whole number (quantity, year) or a decimal (price, weight).

Field type name

number

Settings

Setting Description
Instructions Shown to editors below the field label. (max 2000 characters)
Number Type Whole numbers are returned as integers, decimals as floats.
Default Value Returned when nothing has been saved yet.
Minimum Smallest allowed value. Leave empty for no minimum.
Maximum Largest allowed value. Leave empty for no maximum.
Step Values must be a multiple of the step, counted from the minimum (or 0).
Placeholder Hint shown inside the empty input. (max 255 characters)
Translation How the field behaves in other languages: translate, copy, copy_once or do_not_translate. Used on top-level fields when WPML is active. See WPML.
Width Width on edit screens, to place fields side by side: 100 (full), 75, 66, 50, 33 or 25 (%). Phones always show full width.
Label per language The label and instructions per language code while editing in that language, e.g. {"nl": {"label": "Prijs"}}. Set on the Translation tab when WPML is active. See WPML.

PHP return value

int for whole numbers, float for decimals, or null. 0 is a real value, not "empty".

Example

$price = cafe_get_field( 'price' ); // float, e.g. 19.95

echo esc_html( number_format_i18n( $price, 2 ) );