BEGIN
Declare @ String1 char (20)
Declare @ String2 char (30)
Declare @ String4 Varchar (100)
Declare @ String3 Varchar (100) -- value retrieved from the original A value
Declare @ I int -- Cyclic variable
Declare @ J Int -- the value of A multiplied by the string length of 100
Declare @ brief Varchar (100) -- Chinese reading of numbers
Declare @ Ch2 Varchar (100) -- Chinese character reading of digits
Declare @ Zero Int -- used to calculate the number of consecutive zeros
Declare @ ReturnValue VarChar (100)
Select @ ReturnValue =''
Select @ String1 = 'zero, zero, three, three, two, three, three'
Select @ String2 = 'tens of thousands of yuan worth a thousand yuan a cent'
Select @ String4 = Cast (@ changemone* 100 as int)
Select @ J = len (cast (@ ChangeMoney * 100) as int ))
Select @ String2 = Right (@ String2, @ J)
Select @ I = 1
While @ I <= @ j Begin
Select @ String3 = Substring (@ String4, @ I, 1)
If @ String3 <> '0' Begin
Select @ Substring = Substring (@ String1, Cast (@ String3 as Int) 1, 1)
Select @ Ch2 = Substring (@ String2, @ I, 1)
Select @ Zero = 0 -- indicates that the base is not Zero
End
Else Begin
If (@ Zero = 0) Or (@ I = @ J-9) Or (@ I = @ J-5) Or (@ I = @ J-1)
Select @ resolve = '0'
Else
Select @ region =''
Select @ Zero = @ Zero 1 -- indicates that the base is 0
-- If the value to be converted needs to be expanded, you need to change the value of the following expression I.
Select @ Ch2 =''
If @ I = @ J-10 Begin
Select @ Ch2 = '100'
Select @ Zero = 0
End
If @ I = @ J-6 Begin
Select @ Ch2 = 'wan'
Select @ Zero = 0
End
If @ I = @ J-2 Begin
Select @ Ch2 = 'meta'
Select @ Zero = 0
End
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