• ## Cast() function in SQL

Time：2021-4-19

The cast function is used to explicitly convert an expression of one data type to another. The argument to the cast() function is an expression that includes the source value and the target data type separated by the as keyword. 1、 Grammar: 　　CAST (expression AS data_type) Parameter Description: 　　expression: any valid SQL Server expression. 　　AS: […]

• ## Problems encountered when Python – other – round() preserves decimal places

Time：2021-4-12

Recently, there is a demand that the original integer calculation should be changed to decimal calculation, and one decimal place should be reserved.So according to the demand, the data structure is changed from int to floatround()To retain decimal places. The code of the first edition is as follows: a = 0.1000001 b = round(a+0.1,1) c […]

• ## JS precision difference 0.1 + 0.2! = 0.3

Time：2021-3-1

The number is multiplied by the n-th power of 10, converted into an integer that the computer can accurately identify, and then divided by the n-th power of 10 JS precision console.log(0.1+0.2) // 0.30000000000000004 calculation Var x = 4.23323; // number of tests Var y = string (x). Indexof (“.) + 1; // get the […]

• ## A simple formula calculation tool class

Time：2021-1-28

import java.math.BigDecimal; import java.util.*; /** *Simple formula calculation tool, only support +, -, *, /, () * @author ningyongli * @date 2020-07-13 */ public class CalculateUtils { private static final Map<String, Integer> PRIORITY_MAP = new HashMap<>(); private static final List<String> OPERATOR_LIST = new ArrayList<>(); static { PRIORITY_MAP.put(“(“, 0); PRIORITY_MAP.put(“+”, 5); PRIORITY_MAP.put(“-“, 5); PRIORITY_MAP.put(“*”, 10); PRIORITY_MAP.put(“/”, […]

• ## [Vue + element] text box component that can only input numbers and control decimal places (automatically fill in decimal place 0)

Time：2021-1-22

design sketch major function Only numbers and decimals can be entered You can customize the number of decimal points specified Auto fill 0 of decimal places Preparatory work There is one that can be usedElementVue project for Subcomponents staycomponents/MagicCreate under directoryNumberInput.vuefile Customize the required attribute values and events according to your own needs. Here you […]

• ## Use SQL to generate a data dictionary (MSSQL) for the specified database

Time：2020-2-24

Use dbname — specifies the database to generate the data dictionary GO SELECT Table name = CASE WHEN a.colorder= 1 THEN d.name ELSE ” End, table description= CASE WHEN a.colorder= 1 THEN isnull( f.value, ” ) ELSE ” End, field No. = a.colorder, field name = a.name, identification= CASE WHEN COLUMNPROPERTY( a.id, a.name, ‘IsIdentity’ ) […]

• ## IOS——————- Capitalization of the amount

Time：2019-10-2

-(NSString *)digitUppercase:(NSString *)numstr{ double numberals=[numstr doubleValue];NSArray * numberchar = @[@ Zero,@ One,@ Bi,@ Three,@ Wan,@ Wu,@ Lu,@ Tu,@ Pinch,@ Nine];NSArray*inunitchar= @[@”,@ pick up,@ Bai,@ Tong];NSArray * unitname = @[@”,@ million,@ billion,@ trillion];// The amount multiplied by 100 is converted into a string (with the rounded corner fraction removed) NSString *valstr=[NSString stringWithFormat:@”%.2f”,numberals]; NSString *prefix; NSString *suffix; […]