How to realize the transformation of people's coins in Oracle
Author: ccbzzp
Oracle is very powerful in the reality of the report, especially in reality applications that use the issue of the size of the people's currency, I write a letter to you to introduce briefly, I hope to discuss with you, so as to move together! Common development!
BEGIN
V_money0:=ltrim (RTRIM (To_char (FLOOR)));
Rv_money0:=ltrim (RTRIM (To_char (FLOOR (money*100)));
Rv_money1:=substr (Rv_money0,length (RV_MONEY0), 1);
IF LENGTH (rv_money0) >1 THEN
Rv_money2:=substr (Rv_money0,length (RV_MONEY0) -1,1);
ELSE
rv_money2:= ' 0 ';
End IF;
V_money1:=substr (V_money0,length (V_MONEY0), 1);
IF LENGTH (v_money0) -1>0 THEN
V_money2:=substr (V_money0,length (V_MONEY0) -1,1);
ELSE v_money2:=0;
End IF;
IF LENGTH (v_money0) -2>0 THEN
V_money3:=substr (V_money0,length (V_MONEY0) -2,1);
ELSE v_money3:=0;
End IF;
IF LENGTH (v_money0) -3>0 THEN
V_money4:=substr (V_money0,length (V_MONEY0) -3,1);
ELSE v_money4:=0;
End IF;
IF LENGTH (v_money0) -4>0 THEN
V_money5:=substr (V_money0,length (V_MONEY0) -4,1);
ELSE v_money5:=0;
End IF;
IF LENGTH (v_money0) -5>0 THEN
V_money6:=substr (V_money0,length (V_MONEY0) -5,1);
ELSE v_money6:=0;
End IF;
IF LENGTH (v_money0) -6>0 THEN
V_money7:=substr (V_money0,length (V_MONEY0) -6,1);
ELSE v_money7:=0;
End IF;
IF LENGTH (v_money0) -7>0 THEN
V_money8:=substr (V_money0,length (V_MONEY0) -7,1);
ELSE v_money8:=0;
End IF;
IF LENGTH (v_money0) -8>0 THEN
V_money9:=substr (V_money0,length (V_MONEY0) -8,1);
ELSE v_money9:=0;
End IF;
IF LENGTH (v_money0) -9>0 THEN
V_money10:=substr (V_money0,length (V_MONEY0) -9,1);
ELSE v_money10:=0;
End IF;
IF LENGTH (v_money0) -10>0 THEN
V_money11:=substr (V_money0,length (V_MONEY0) -10,1);
ELSE v_money11:=0;
End IF;
IF LENGTH (v_money0) -11>0 THEN
V_money12:=substr (V_money0,length (V_MONEY0) -11,1);
ELSE v_money12:=0;
End IF;
Sql*plus:release 9.2.0.1.0-production on Tuesday July 29 15:03:36 2003
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
Connections to:
Oracle8i Enterprise Edition Release 8.1.6.1.0-production
With the partitioning option
Jserver Release 8.1.6.0.0-production
Sql> Select Dx_money (324450567.89) from dual;
Dx_money (324450567.89)
--------------------------------------------------------------------------------
For billions of 貳, Wu Bai land to pick up nine points
3. The maximum number of words in this example is 999999999999.99
4. The above function is more simple to understand, the language is not necessarily simple, welcome to join the discussion!
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.