int Changenum (char* str){Char revstr[16]={0}; Depending on the length of the hexadecimal string, note that the array does not crossint num[16]={0};int count=1;int result=0;int length;Length = strlen (str);memcpy (Revstr, "0x", 2);memcpy (Revstr + 2,str,length);length + = 2;for (int i=length-1;i>=0;i--){if ((revstr[i]>= ' 0 ') (revstr[i]The ASCII value of num[i]=revstr[i]-48;//character 0 is 48else if ((revstr[i]>= ' a ') (revstr[i]num[i]=revstr[i]-' a ' +10;else if ((revstr[i]>= ' A ') (revs
SQL> select Ceil (23.33) from dual;Ceil (23.33)-----------24Elapsed: 00:00:00. 30SQL> select role (23.33) from dual;Round (23.33)------------23Elapsed: 00:00:00. 30
SQL> select floor (12.23) from dual;Floor (12.23)------------12SQL> select trunc (12.23) from dual;Trunc (12.23)------------12
Select round (2.34) from dual;2Select round (2.34, 0) from dual;2The second parameter of round defaults to 0, which is an integer.
Round () is rounding, not an integer ..Ceil () is a
The regular expression verifies that the number format is not negative and the two digits are retained after the decimal point. The regular expression is as follows:
^ ([1-9] +) | ([0-9] + \. [0-9] {1, 2}) $
Tested. Very accurate. Attached JS judgment method:
Function checkmoneyformat (VAL ){VaR Reg =/^ ([1-9] +) | ([0-9] + \. [0-9] {1, 2}) $ /;VaR ismoneyformatright = reg. Test (VAL );Return ismoneyfo
When processing the data of the currency type, we often encounter the display of the data of the currency type. For example, on a Chinese machine, the display format is always ¥50,200.00,
If we want to display a format like $50,200, two points are involved:1. Set the current region to the United States. 2. Set the number of decimal places for the amount to 0.
We can create a base class basepage an
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.