Convert RMB to uppercase in lower case

Source: Internet
Author: User
  1. /**
  2. * Convert the lowercase value to uppercase.
  3. * @ Param Input
  4. * @ Return
  5. */
  6. Public static string numtochinese (string input ){
  7. String S1 = "";
  8. String S4 = "getting hundreds of millions of users and hundreds of millions of users in different regions ";
  9. String temp = "";
  10. String result = "";
  11. If (input = NULL) Return "the input string is not a numeric string and can only contain the following characters ('0 ′~ '9', '.'), the maximum input string can be precise to hundreds of millions, only two decimal places! ";
  12. Temp = input. Trim ();
  13. Float F;
  14. Try {
  15. F = float. parsefloat (temp );
  16. } Catch (exception e) {return "the input string is not a numeric string and can only contain the following characters ('0 ′~ '9', '.'), the maximum input string can be precise to hundreds of millions, only two decimal places! ";}
  17. Int Len = 0;
  18. If (temp. indexof (".") =-1) Len = temp. Length ();
  19. Else Len = temp. indexof (".");
  20. If (LEN> s4.length ()-3) return ("the maximum input string can be accurate to million, and only two decimal places can be entered! ");
  21. Int N1, N2 = 0;
  22. String num = "";
  23. String unit = "";
  24. For (INT I = 0; I <temp. Length (); I ++ ){
  25. If (I> Len + 2) {break ;}
  26. If (I = Len) {continue ;}
  27. N1 = integer. parseint (string. valueof (temp. charat (I )));
  28. Num = s1.substring (N1, N1 + 1 );
  29. N1 = len-I + 2;
  30. Unit = s4.substring (N1, N1 + 1 );
  31. Result = result. Concat (Num). Concat (unit );
  32. }
  33. If (LEN = temp. Length () | (LEN = temp. Length ()-1) Result = result. Concat ("whole ");
  34. If (LEN = temp. Length ()-2) Result = result. Concat ("0 ");
  35. Return result;
  36. }

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.