Wie unten gezeigt:
öffentliche statische String-RethreESTR (String ss) {boolean result = ss.Matches ("^[-+]? (([0-9]+) ([.] ([0-9]+)? | ([.] ([0-9]+)?) $"); if (result && ss! = null &&! ". String numstr = new java.text.decimalFormat ("0,000"). Format (SSS); Double lsdou = dou.valueof (numstr); ss = string.Valueof (lsdou); } return ss; } public static BigDecimal Retheebig (BigDecimal SS) {String numstr = new java.text.decimalFormat ("0,000"). Format (SS); BigDecimal newnum = new BigDecimal (Numstr); return newnum;} public static String Delezero (String Old) {boolean result = old.matches ("^[-+]? (([0-9]+) ([.] ([0-9]+)? | ([.] ([0-9]+)?) $"); if (result && alt! if (old.contains (". 0")) {Old = NewStr.Substring (0, Old.Length ()-2); } alter zurückkehren; } else {return Old; }}Der obige Artikel über die Java -POI -Analyse der öffentlichen Methode von Excels Data Conversion (empfohlen) ist der gesamte Inhalt, den ich mit Ihnen teile. Ich hoffe, Sie können Ihnen eine Referenz geben und ich hoffe, Sie können wulin.com mehr unterstützen.