Linux -Blue forest free software | Return to home page | Site Map | Search WWW | Contact Us |
Your current position : Homepage > Free Software > Technological exchanges >Database


    

Blue Forest http://www.lslnet.com at 3:18 p.m. on August 26, 2006


Help convert invoices capital : RMB lowercase form

Please help me figure in the Oracle database to write a lowercase forms of capital into yuan invoice function, thank you!

Help convert invoices capital : RMB lowercase form

I had an ah. But in achieving the PB ah?

Help convert invoices capital : RMB lowercase form

Do not know decode () Can

Help convert invoices capital : RMB lowercase form

Programming to solve this problem and solve it directly to the Oracle database is a certain difficulty, unlike C or other query languages.
Landlord can find C to C version of the solution, whether we can look into the query in the function
[code]create Or replace function num_hz (also published in number) return is varchar
Begin
...
End;[/code]

Help convert invoices capital : RMB lowercase form

CREATE OR REPLACE FUNCTION L2U -- lowercase converted to write big ones
(
N_LowerMoney IN NUMBER
)
RETURN VARCHAR2
AS
V_LowerStr VARCHAR2 (200); -- Lowercase amount
V_UpperPart VARCHAR2 (200);
V_UpperStr VARCHAR2 (200); -- Amount
BEGIN
V_LowerStr : = LTRIM (RTRIM (TO_CHAR (ROUND (n_LowerMoney,2), '9999999999999.99')));
IF Substr (v_LowerStr,1,1) = '#' THEN
RETURN 'conversion over terms of reference (terms of reference for the calculation of : : 0-9,999,999,999,999.99)';
Sound IF;
I IN FOR 1. . LENGTH (v_LowerStr) Loop
SELECT DECODE (Substr (v_LowerStr, LENGTH (v_LowerStr) - I + 1,1).
'. 'And' million '
'0', 'zero' and 'one', '0111,' 'two' and 'Two' and 'three' and 'triplet', 'four' and 'recklessly'
'Five' and 'Mrs.' and 'six' and 'land' and 'seven', 'Qi' and 'eight' and 'split', and 'nine', 'Jiu') | |
DECODE (I,1 'minutes', 2,' Point ', 3, NULL,4, NULL,5,' up ', 6', 100 ', 7' 960 ', 8' million '
9, the 'up', 10 '632' 11 '960' 12 'billion', 13 'up', 14 '632' 15 '960' 16 '10,000', NULL)
INTO v_UpperPart FROM DUAL;
V_UpperStr : = v_UpperPart||v_UpperStr;
Sound LOOP;

V_UpperStr : = REPLACE (v_UpperStr 'zero-up' and 'zero');
V_UpperStr : = REPLACE (v_UpperStr 'zero - 632', 'zero');
V_UpperStr : = REPLACE (v_UpperStr 'zero-960', 'zero');
V_UpperStr : = REPLACE (v_UpperStr '2000', 'zero');
V_UpperStr : = REPLACE (v_UpperStr '2003', 'zero');
V_UpperStr : = REPLACE (v_UpperStr 'zero-zero angle' and 'whole');
V_UpperStr : = REPLACE (v_UpperStr, 'zero', the 'whole');
V_UpperStr : = REPLACE (v_UpperStr 'zero angle' and 'zero');
V_UpperStr : = REPLACE (v_UpperStr 'is 102 million million million', 'billion');
V_UpperStr : = REPLACE (v_UpperStr '102 million million million', 'billion');
V_UpperStr : = REPLACE (v_UpperStr 'is 102 million million', 'billion');
V_UpperStr : = REPLACE (v_UpperStr '15 million yuan,' 'million');
V_UpperStr : = REPLACE (v_UpperStr '10,000 yuan,' 'million');
V_UpperStr : = REPLACE (v_UpperStr 'zero-million', 'billion');
V_UpperStr : = REPLACE (v_UpperStr '15 million' and 'million');
V_UpperStr : = REPLACE (v_UpperStr 'zero' and 'million');
V_UpperStr : = REPLACE (v_UpperStr '2003', 'zero');

1106 -- less than the amount of processing
V_UpperStr : = LTRIM (LTRIM (LTRIM (LTRIM (v_UpperStr 'million'), 'zero'), 'Kok'), 'breakdown');
IF Substr (v_UpperStr,1,1) = 'whole' THEN
V_UpperStr : = 'yuan whole';
Sound IF;
RETURN v_UpperStr;
EXCEPTION WHEN OTHERS THEN
RETURN 'error :' ||SQLCODE|| '--' ||SQLERRM;
Sound L2U;
/

Help convert invoices capital : RMB lowercase form

CREATE OR REPLACE FUNCTION L2U (m FLOAT) RETURN IS VARCHAR2
Result VARCHAR2 (100);
BEGIN
SELECT
DECODE (FLOOR (NVL (m,0) / (100000*100)), 1, 'Yi Shi', 2, 'defines', 3' Sanshi ', 4' PPS ', 5' Affirmative ', 6' land up ', 7' Chengwu 'eight,' Bashi ', 9' Jiu Shi ',' ') | |
DECODE ((FLOOR (NVL (m,0) / (10000*100)) -
FLOOR (NVL (m,0) / (100000*100)) * 10), 1, 'Yi Mo', 2, 'Two million', 3 'San Mo', 4 'to carry out 10,000', 5 'Mrs. million', 6 'land 10,000', 7, 'qi 10000', 8 'assembly 10000', 9 'Jiu million'
DECODE (FLOOR (NVL (m,0) / (100000*100)), 0, '' and 'up 10000')) | |
DECODE ((FLOOR (NVL (m,0) / (1000*100)) -
FLOOR (NVL (m,0) / (10000*100)) * 10), 1 '0111 960', 2, 'Two 960', 3 'triplet 960', 'wantonly 960', 5 'Kivu 960', 6, 'Mr 960', 7, 'Qi 960', 8 'assembly 960', 9 'Jiu 960'
DECODE (FLOOR (ROUND (NVL (m,0) /100,2) per 1000), 0, '', 'zero')) | |
DECODE ((FLOOR (NVL (m,0) / (100*100)) -
FLOOR (NVL (m,0) / (1000*100)) * 10), 1, 'selected', 2, 'Erbai', 3 'triplet 632', 4 'Sibai', 5 'Wu Bai', 6, 'Mr 632', 7 'Qibai', 8 'assembly 632', 9 'Jiu Bai'
DECODE (FLOOR (NVL (m,0) / (1000*100)), 0, ''
DECODE (FLOOR (ROUND (NVL (m,0) /100,2) per 100), 0, '', 'zero'))) | |
DECODE ((FLOOR (NVL (m,0) / (10*100)) -
FLOOR (NVL (m,0) / (100*100)) * 10), 1, 'Yi Shi', 2, 'defines', 3' Sanshi ', 4' PPS ', 5' Affirmative ', 6' land up ', 7' Chengwu 'eight,' Bashi ', 9' Jiu Shi '
DECODE (FLOOR (NVL (m,0) / (100*100)), 0, ''
DECODE (FLOOR (ROUND (NVL (m,0) /100,2) 10), 0, '', 'zero'))) | |
DECODE ((FLOOR (NVL (m,0) per 100) -
FLOOR (NVL (m,0) / (10*100)) * 10), 1, the 'dollar', 2, 'Eryuan', 3 'triplet million', 'wantonly million', 5 'Mrs. yuan', 6, 'Lu Yuan', 7, 'qi yuan', 8 'assembly yuan', 9 'Jiu million'
DECODE (FLOOR (ROUND (NVL (m,0) /100,2)), 0, '', 'zero')) | |
DECODE ((FLOOR (ROUND (NVL (m,0), 2) 10) -
FLOOR (NVL (m,0) per 100) * 10), 1, 'cents', 2' 20 cents', 3 'Sanjiao', 'wantonly Point', 5 'Wu Jia', 6, 'Mr Kok' ,7 '- qi Point', 8 'assembly Point', 9 'Jiu angle' and 'Zero Point') | |
DECODE ((FLOOR (ROUND (NVL (m,0) 2)) -
FLOOR (ROUND (NVL (m,0), 2) 10) * 10), 1 '0111 hours', 2', two ', 3' Sanfen ', 4' fourthundredths', 5 'Mrs. minutes', 6' landing minutes' ,7 '- qi minutes', 8' assembly hours', 9 'Jiu minutes',' zero ') AS RMBCODE
INTO Result
FROM dual;
   
RETURN (Result);
Sound L2U;
/

Help convert invoices capital : RMB lowercase form

Formidable



 Privacy Policy  Copyright © 1999-2000 LSLNET.COM. All rights reserved. Blue Forest website owners. E-mail : Webmaster@lslnet.com