Split amount by formula
In the process of building YIDA applications, you may encounter the following problems.
- In the financial management system, when making financial account records, ensure that every record is accurate to score, so as to provide accurate accounting information and monetary management.
- In the salary management system, human resources management needs to ensure that the payment of salary and allowance is accurate to score to meet the requirements of salary slip.
The maximum number of decimal places is two.
Prerequisites
This tutorial uses the form formula of YIDA. You can first understand the followingForm formula.
Effect
Implementation steps
Create a common form page
Create a common form page. For more information, seeCommon form.
Drag the following components into the canvas area.
- Numerical value: Named as amount
- Scale setting 2
- Numerical value: Named 100 million
- Numerical value: named tens of millions
- Numerical value: Named millions
- Numerical value: named 100,000
- Numerical value: named ten thousand
- Numerical value: Named thousands
- Numerical value: named Hundred
- Numerical value: named Ten
- Numerical value: Named Meta
- Numerical value: named angular
- Numerical value: Named as score
Add Form formula
Select Formula edit and configure the formula shown in the following figure. You can also directly copy the formula source code and pay attention to modifying the fields.
{"text":"INT(金额/100000000)","marks":[{"from":{"line":0,"ch":4,"sticky":null},"to":{"line":0,"ch":8,"sticky":null},"value":"numberField_lzaw013z","invalid":false}],"isCmData":true}
Select Edit formula and configure the formula shown in the following figure. You can also directly copy the formula source code and modify the fields.
{"text":"INT(MOD(金额,100000000)/10000000)","marks":[{"from":{"line":0,"ch":8,"sticky":null},"to":{"line":0,"ch":12,"sticky":null},"value":"numberField_lzaw013z","invalid":false}],"isCmData":true}
Millions select formula editing and configure the formula shown in the following figure. You can also directly copy the formula source code and pay attention to modifying the fields.
{"text":"INT(MOD(金额,10000000)/1000000)","marks":[{"from":{"line":0,"ch":8,"sticky":null},"to":{"line":0,"ch":12,"sticky":null},"value":"numberField_lzaw013z","invalid":false}],"isCmData":true}
Select Formula editing and configure the formula shown in the following figure. You can also directly copy the formula source code and pay attention to modifying the fields.
{"text":"INT(MOD(金额,1000000)/100000)","marks":[{"from":{"line":0,"ch":8,"sticky":null},"to":{"line":0,"ch":12,"sticky":null},"value":"numberField_lzaw013z","invalid":false}],"isCmData":true}
Select Formula editing and configure the formula shown in the following figure. You can also directly copy the formula source code and pay attention to modifying the fields.
{"text":"INT(MOD(金额,100000)/10000)","marks":[{"from":{"line":0,"ch":8,"sticky":null},"to":{"line":0,"ch":12,"sticky":null},"value":"numberField_lzaw013z","invalid":false}],"isCmData":true}
Edit the formula and configure the formula shown in the following figure. You can also copy the source code of the formula directly. Pay attention to modifying the fields.
{"text":"INT(MOD(金额,10000)/1000)","marks":[{"from":{"line":0,"ch":8,"sticky":null},"to":{"line":0,"ch":12,"sticky":null},"value":"numberField_lzaw013z","invalid":false}],"isCmData":true}
Edit the formula and configure the formula shown in the following figure. You can also copy the source code of the formula directly. Pay attention to modifying the fields.
{"text":"INT(MOD(金额,1000)/100)","marks":[{"from":{"line":0,"ch":8,"sticky":null},"to":{"line":0,"ch":12,"sticky":null},"value":"numberField_lzaw013z","invalid":false}],"isCmData":true}
Select Formula edit and configure the formula shown in the following figure. You can also directly copy the formula source code and pay attention to modifying the fields.
{"text":"INT(MOD(金额,100)/10)","marks":[{"from":{"line":0,"ch":8,"sticky":null},"to":{"line":0,"ch":12,"sticky":null},"value":"numberField_lzaw013z","invalid":false}],"isCmData":true}
Edit the meta formula and configure the formula shown in the following figure. You can also directly copy the source code of the formula and pay attention to modifying the fields.
{"text":"MOD(金额,10)","marks":[{"from":{"line":0,"ch":4,"sticky":null},"to":{"line":0,"ch":8,"sticky":null},"value":"numberField_lzaw013z","invalid":false}],"isCmData":true}
Select an angle formula to edit and configure the formula shown in the following figure. You can also directly copy the formula source code and pay attention to modifying the fields.
{"text":"INT((金额-INT(金额))*10)","marks":[{"from":{"line":0,"ch":5,"sticky":null},"to":{"line":0,"ch":9,"sticky":null},"value":"numberField_lzaw013z","invalid":false},{"from":{"line":0,"ch":14,"sticky":null},"to":{"line":0,"ch":18,"sticky":null},"value":"numberField_lzaw013z","invalid":false}],"isCmData":true}
Select Formula editing and configure the formula shown in the following figure. You can also directly copy the formula source code and pay attention to modifying the fields.
{"text":"MOD(INT((金额-INT(金额))*100),10)","marks":[{"from":{"line":0,"ch":9,"sticky":null},"to":{"line":0,"ch":13,"sticky":null},"value":"numberField_lzaw013z","invalid":false},{"from":{"line":0,"ch":18,"sticky":null},"to":{"line":0,"ch":22,"sticky":null},"value":"numberField_lzaw013z","invalid":false}],"isCmData":true}