GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — java2python/test/Format1.java at master · jcoder2012/java2python Expand file tree/ Copy pathFormat1.javaMore file actions 19 lines (16 loc) · 716 Bytes / Copy pathFormat1.javaFile metadata and controls19 lines (16 loc) · 716 Bytes 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 public class Format1 { public static void main(String[] args) { long n = 461012; String f1 = String.format("%d%n", n); // --> "461012" String f2 = String.format("%08d%n", n); // --> "00461012" String f3 = String.format("%+8d%n", n); // --> " +461012" String f4 = String.format("%,8d%n", n); // --> " 461,012" String f5 = String.format("%+,8d%n", n); // --> "+461,012" System.out.println(f1 + f2 + f3 + f4 + f5); double pi = 3.14159265; String pf1 = String.format("%f%n", pi); // --> "3.141593" String pf2 = String.format("%.3f%n", pi); // --> "3.142" String pf3 = String.format("%10.3f%n", pi); // --> " 3.142" System.out.println(pf1 + pf2 + pf3); } } |
| You are visitor 01402520 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |