DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:struct:type_decimal

This is an old revision of the document!


Struct PluginTypes

Struct Plugin: Type Decimal

The Decimal type holds decimal numbers also known as float or double. Upper and lower bounds can be set through the config. The decimal point and thousands separator can be configured. Values can be rounded and trailing zeros be trimmed.

Internally values are always stored with a dot as decimal point.

Values can be entered with a dot or comma, but may not contain thousand separators.

Configuration

The following configuration is available in addition to the basic type configuration:

Config Format Description
format string A sprintf format string to output the number (should contain some variation on %F) The decimal point . will be replaced by the configured one from the decpoint option below.
min integer The number has to be at least this value. Be sure to specify decimals with a . as decimal point!
max integer The number may be at most this value. Be sure to specify decimals with a . as decimal point!
decpoint char The character to use as a decimal point in output. You probably want to use either . or ,. Regardless of this setting, users may always enter values with either of the two.
plugin/struct/type_decimal.1459933569.txt.gz · Last modified: 2016-04-06 11:06 by andi

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki