Skip to main content

How to convert an amount to uppercase

In daily use YIDA, in many scenarios, the value of the entered numeric field needs to be converted to uppercase. For example, the amount in the contract needs to be converted to uppercase for printing.

The following shows how to write different functions that convert numbers into uppercase.

1. Amount converted to uppercase (including angular points)

When the number is converted to uppercase, there are usually two situations: one is the amount number to uppercase, and the other is the ordinary number to uppercase.

When the amount number is converted to uppercase, the required functions are as follows:

  • RMBFORMAT:Format in RMB format

The following code can be directly copied to the formula editor,Note the replacement amount Field.

{"text":"RMBFORMAT(​金额​)","marks":[{"from":{"line":0,"ch":10,"sticky":null},"to":{"line":0,"ch":14,"sticky":null},"value":"numberField_ksr4oq3u","invalid":false}],"isCmData":true}

2. Convert numbers to uppercase amounts (excluding angular points)

When the number is converted to uppercase, there are usually two situations: one is the amount number to uppercase, and the other is the ordinary number to uppercase.

When the amount number is converted to uppercase, the required functions are as follows:

  • RMBFORMAT:Format in RMB format
  • INT:The number is rounded down to the nearest integer.

The following code can be directly copied to the formula editor,Note the replacement amount Field.

{"text":"RMBFORMAT(INT(​金额​))","marks":[{"from":{"line":0,"ch":14,"sticky":null},"to":{"line":0,"ch":18,"sticky":null},"value":"numberField_ksr4oq3u","invalid":false}],"isCmData":true}

3. Convert numbers to uppercase (excluding decimal points)

The formula used to convert numbers to uppercase without decimal points is:

  • RMBFORMAT:Format in RMB format
  • INT:The number is rounded down to the nearest integer.
  • MID:In A string, C characters are retrieved from bit B.
  • VALUE:Convert text to numbers
  • LEN:Returns the number of characters in a text string.

The following code can be directly copied to the formula editor,Note the replacement amount Field.

{"text":"MID(RMBFORMAT(​金额​),1,VALUE(LEN(RMBFORMAT(INT(​金额​)))-2))","marks":[{"from":{"line":0,"ch":14,"sticky":null},"to":{"line":0,"ch":18,"sticky":null},"value":"numberField_ksr4oq3u","invalid":false},{"from":{"line":0,"ch":46,"sticky":null},"to":{"line":0,"ch":50,"sticky":null},"value":"numberField_ksr4oq3u","invalid":false}],"isCmData":true}

4. Convert numbers to uppercase (including decimal point)

The formula used to convert numbers to uppercase with decimal points is:

  • IF:IF
  • ISEMPTY:Determines whether a field is empty. If it is empty, true is returned. If it is not empty, false is returned.
  • CONCATENATE: Merge multiple text strings into one text string;
  • SPLIT(text, text_separator):Divide text into arrays based on the specified string, which must be used with ARRAYGET functions;
  • ARRAYGET(Array, k):Returns the k-th value in the dataset;
  • TEXT(num,text_format):Convert numbers into text in a specific format;
  • LEN:Returns the number of characters in a text string;
  • INT:The number is rounded down to the nearest integer;
  • MID:In A string, C characters are extracted from bit B;
  • VALUE:Convert text to numbers;
  • RMBFORMAT:Format in RMB format;
  • LEFT:Returns a specified number of characters starting from the first character of a text string. If the length of the text is less than the number of custom characters, the original text is returned;

The following code can be directly copied to the formula editor,Note the replacement amount Field.

{"text":"IF(ISEMPTY(ARRAYGET(SPLIT(​金额​,\".\"),2)),CONCATENATE(MID(RMBFORMAT(​金额​),1,VALUE(LEN(RMBFORMAT(INT(​金额​)))-2))),CONCATENATE(MID(RMBFORMAT(​金额​),1,VALUE(LEN(RMBFORMAT(INT(​金额​)))-2)),\"点\",LEFT(RMBFORMAT(MID(ARRAYGET(SPLIT(​金额​,\".\"),2),1,1)),1),LEFT(RMBFORMAT(MID(ARRAYGET(SPLIT(​金额​,\".\"),2),2,1)),1)))","marks":[{"from":{"line":0,"ch":26,"sticky":null},"to":{"line":0,"ch":30,"sticky":null},"value":"numberField_ksr9w5kj","invalid":false},{"from":{"line":0,"ch":66,"sticky":null},"to":{"line":0,"ch":70,"sticky":null},"value":"numberField_ksr9w5kj","invalid":false},{"from":{"line":0,"ch":98,"sticky":null},"to":{"line":0,"ch":102,"sticky":null},"value":"numberField_ksr9w5kj","invalid":false},{"from":{"line":0,"ch":137,"sticky":null},"to":{"line":0,"ch":141,"sticky":null},"value":"numberField_ksr9w5kj","invalid":false},{"from":{"line":0,"ch":169,"sticky":null},"to":{"line":0,"ch":173,"sticky":null},"value":"numberField_ksr9w5kj","invalid":false},{"from":{"line":0,"ch":219,"sticky":null},"to":{"line":0,"ch":223,"sticky":null},"value":"numberField_ksr9w5kj","invalid":false},{"from":{"line":0,"ch":275,"sticky":null},"to":{"line":0,"ch":279,"sticky":null},"value":"numberField_ksr9w5kj","invalid":false}],"isCmData":true}

5. Effect demonstration

Click the form to view the conversion effect directly:Click View

YIDA in order to better optimize the content and quality of YIDA user manual, it takes you 3-5 minutes to fill in the document feedback questionnaire. The document feedback questionnaire is submitted anonymously, and the questionnaire information is only used for YIDA document experience feedback collection. Thank you for your support for YIDA!

Click here to fill in the questionnaire


-------------------- Get the latest information YIDA, welcome to follow US--------------------

This doc is generated using machine translation. Any discrepancies or differences created in the translation are not binding and have no legal effect for compliance or enforcement purposes.
Copyright © 2024钉钉(中国)信息技术有限公司和/或其关联公司浙ICP备18037475号-4