DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:struct:type_decimal

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Both sides next revision
plugin:struct:type_decimal [2016-04-06 10:13]
andi
plugin:struct:type_decimal [2016-04-14 11:59] (current)
130.112.1.3 [Configuration]
Line 2: Line 2:
 ====== Struct Plugin: Type Decimal ====== ====== 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 can be configured. Internally a dot is always used and savedThousand separators are not supported.+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 ===== ===== Configuration =====
Line 8: Line 12:
 The following configuration is available in addition to the basic type [[type#configuration]]: The following configuration is available in addition to the basic type [[type#configuration]]:
  
-^ Config    ^ Format   ^ Description                                                                                                                                                                           ^ +^ Config     ^ Format   ^ Description                                                                                                                                                                           ^ 
-| format    | string   | A [[phpfn>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!                                                                                  | 
-| 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!                                                                                      | 
-| max       | integer  | The number may be at most this value. Be sure to specify decimals with a ''.'' as decimal point!                                                                                      | +roundto    | integer  | The number of decimals the values should be rounded to. Use ''-1'' for no rounding.                                                                                                    | 
-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.  | +| 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.  | 
 +| thousands  | char     | The character to use as a thousands separator. The default is a thin non-breaking space.                                                                                              | 
 +| trimzeros  | boolean  | If true, trailing zeros are stripped from the decimals.                                                                                                                               | 
 +| prefix | string | This text will be prepended to the saved value - useful for currency symbols | 
 +| postfix | string | This text will be appended to the saved value - useful for currency symbols |
  
plugin/struct/type_decimal.1459930396.txt.gz · Last modified: 2016-04-06 10:13 by andi