Support > Repository > Definition of model items > Numerical value
ja | en

I will explain the use point of numerical type.

Numeric types can also specify several attributes."Model definition> type>Types available in WagbyPlease read.

The settings such as "input rule" and "output format" described later are valid when the type of input item is "number".Normally, the type of input item is "number".If this setting is left blank, the input item is treated as a character string.[More ...]

Figure 1 Types of input items

In Wagby, the entered value is corrected by "filter"."Filter" can be automatically corrected by the filter.This function is set automatically.

The filters that can be selected for numerical type items are as follows.

Numeric type

It is a filter that judges an input value as a numerical value and converts it to a numeric type.All figures entered in full-width characters are unified into one-byte characters.

Figure 2 Input filter
Both the Web form, upload update, and REST API are used in common for the filter.

Cursor position

In the numerical type item, the cursor position on the registration/update screen is "Right".(It can not be changed.Regardless of the type, this rule applies.[Unlock this constraint ...]

Figure 3 Cursor position

Check for non-numeric characters

In the case of numerical type items, if you enter anything other than numbers, input checking will be applied in real time. Double-byte characters can not be entered.(Figure 4)

Figure 4 Error when entering full-width "1"

Maximum number of digits that can be entered

The maximum number of digits that can be entered is 15 digits.Regardless of the type, this rule applies.[Unlock this constraint ...]

Figure 5 Error message when exceeding the maximum number of digits that can be entered

Fraction part that can be entered

The decimal part you can enter is 6 digits.Regardless of the type, this rule applies.[Unlock this constraint ...]

Figure 6 Error message when entering more than the decimal part
This rule applies only to the input screen.When values ​​obtained by calculation, upload update, and REST API are used, they can be held within the range of the specified type.
We set a valid numerical range for business,Specify range checkWould be nice.

Example of operation

Figure 7 shows an example in which numbers are set to be output in 3-digit separator.

Figure 7 Price is displayed in 3-digit separator

This format specification also applies when entering.It is formatted at the timing when the focus of the cursor moves.(It is not under input.)

Fig. 8 Format is applied at the timing when input is completed

Setting method

Specify "Output control> Detail screen> Format" in the model item detail definition dialog.
(There is no setting field on the list screen.The format specified here applies to the list screen.)

Figure 9 Specifying the output format

Available format

The following format notation is prepared by choice.

Format specification Stored number Outputted notation
###,###.### 1234.56 1,234.56
000,000.000 1234.56 001,234.560
###.##% 0.5 50%
\###,### (*1) 10000 ¥ 10,000
#, 12800 12,800
-12800 ▲ 12,800

Behavior when format is not specified 7.10.2

For 4 byte floating point/8 byte floating point item, when format is not specified, it becomes as follows.

R7.10.2 or later Until R7.10.1
Default format ##0.0#### ###.#####
the difference Entering "5" displays "5.0". Entering "5" will display "5".

Define your own format

Users can also prepare their own numerical formats. The following pattern letters can be used.

Details are provided by the Java class library Documentation of the java.text.DecimalFormat classPlease refer to.

symbol meaning
0 A number
# Numbers.It is not displayed as zero.
. Numeric digit separator (or thousands separator of passage)
- Minus sign
, Group break
; Separate positive and negative subpatterns
% 100 times to represent percent

Example: The integer part is divided into 3 digits, and the numerical values ​​up to the fifth decimal place are output

#,##0.00000

Example: Output the numerical value up to the first decimal place as it is, with the integer part as it is

When the value is "1", it becomes "1.0" when displayed.

0.0

Example: For integers only integer, only output to decimal point if input to decimal point

###.##

For example, if you enter "1500" and (integer only), "1500" is displayed.When you enter "141.14" (value including decimal point) "141.14" is displayed.

If you want to convert the integer part into three digits separated by commas, do as follows.

###,###.##

For example, if you enter "1500" and (integer only), "1,500" is displayed.

Example: handling percent

If you specify the "%" character in the format,Calculation result is automatically multiplied by 100.It can be realized (100 times) without using calculation formulas.

###.0%

When you enter 1, "100.0%" is displayed.

If you want to enter 0.1 for 10% and for 0.8 for 80%, do as follows.

###.##%

To display more than two decimal places, increase "0" and specify it.For example, to display up to 3 decimal places, specify as follows.

###.000%

If you want to display only the decimal point value entered, do as follows.

###.0##%

In the above format, if you enter 0.152, 15.2% is displayed.

Deprecated format

The use of the decimal point is deprecated in the notation

Notes on decimal point treatment

In the case of a decimal number, if the actual value is larger than the format specified number of digits, "Rounding" processing ("Rounding", "Round up", "Round down") is done automatically.In case of fraction, this judgment matches the nearer number above and below that.

Example) Number of designated digits: 2 decimal places
"0.123" will be "0.12".
"0.127" is "0.13".
"0.125" is rounded to the even side and becomes "0.12".
("5" of "0.125" is rounded to "0.12" which is "even number" since it is the same distance to both upper and lower numbers "0.12" and "0.13".)
"0.135" is rounded to the even side and becomes "0.14".

Specifications concerning handling of decimal numbers conform to "JIS rounding" (JIS Z 8401) of the Japanese Industrial Standard.

Handling of circle mark

If you specify a format with a circle mark (example:

In case of reference linkage item

In the case of reference linked item type, the setting of the reference model is reflected in the output format.

Troubleshooting: Output format is not reflected

Please check whether the type of input item is "number".[More ...]

"Input control>Do not display initial values ​​of date/numeric valuePlease read.

"Search control>Perform range searchPlease read.

For numeric values, the following rules are applied automatically in the input field.

  • The position of the input cursor is right.
  • The maximum number of digits that can be entered is 15 digits.
  • You can enter 6 decimal places.

If you need to cancel this constraint in business tasks, make the following settings.

Open the "Input control" tab of the target item.In case of numerical value, both "input item type" and "input item type (smartphone)" are "numbers".

Figure 10 Types of input items

Leave this field blank.Since the input field is handled as a character string type, the number of digits check processing is no longer performed.

Fig. 11 Canceling the type of input item
When handling large numbers of 15 digits or more, change the type to "8 byte integer".However, numbers that can be handled are in the range of -9, 223, 372, 036, 854, 775, 808 to 9, 223, 372, 0,Similarly, when handling a decimal point exceeding 6 digits, change the type to "8 byte floating point number".The accuracy that can be handled is roughly 15 digits of precision below the decimal point.[More ...]
When you cancel the type of input item, "Input rule"Or"Output formatWill no longer work.

The standard sizes of numeric types stored in the database are as follows.

Database Type Definition
Oracle integer number(10,0)
1 byte integer number(3,0)
2 byte integer number(5,0)
4 byte integer number(10,0)
8 byte integer number(19,0)
4 byte floating point number float
8 byte floating point number double precision
SQL Server integer int
1 byte integer tinyint
2 byte integer smallint
4 byte integer int
8 byte integer numeric(19,0)
4 byte floating point number float
8 byte floating point number double precision
DB 2 integer integer
1 byte integer smallint
2 byte integer smallint
4 byte integer integer
8 byte integer bigint
4 byte floating point number float
8 byte floating point number double
MySQL integer integer
1 byte integer tinyint
2 byte integer smallint
4 byte integer integer
8 byte integer bigint
4 byte floating point number float
8 byte floating point number double precision
PostgreSQL integer int4
1 byte integer int2
2 byte integer int2
4 byte integer int4
8 byte integer int8
4 byte floating point number float4
8 byte floating point number float8
HSQLDB (embedded DB) integer int4
1 byte integer int2
2 byte integer int2
4 byte integer int4
8 byte integer int8
4 byte floating point number float4
8 byte floating point number float8