Forced conversion of data of type P and N to type C

Source: Internet
Author: User

The P type is a decimal value. Let's look at a definition first.
G_p17 type p decimals 2.

Here, g_p17 has 17 digits (13-digit integer, 1 decimal point, 2 decimal places, and 1 plus or minus sign ).
 
P --> C
When creating some interface files, such as TXT and EXCEL, we may want to forcibly convert g_p to type C data. At this time, the definition of C should be 17 bits.
G_c17 TYPE CHAR17.
And then convert it. The following shows a simple result.

-------------------------
P --> N
P ---> N if P is forcibly assigned to it, the positive and negative signs are removed and automatically rounded.

 
---------------------------------------------------

2. The N type is full-data without characters (including decimal points), and the leading 0 is automatically added.

 


 
-------------------------------
C --> N
C ---> if N is forcibly assigned to it, it is automatically filtered.
 
 
This method can be used to retrieve data from characters.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.