Tag Archives: format

30,984 views

Formatting a Number to String NumberFormat DecimalFormat locale Java Android example code

NumberFormat, DecimalFormat, format(), locale format Java Androidexample source code NumberFormat numberFormat = new DecimalFormat("##"); String str = numberFormat.format(-01234.567); // -1235 System.out.print(str + "\n");   str = numberFormat.format(00); // 0 System.out.print(str + "\n");   numberFormat = new DecimalFormat("##00"); str = numberFormat.format(0); … Continue reading

Posted in Android Examples Code | Tagged , , , , , | Comments Off on Formatting a Number to String NumberFormat DecimalFormat locale Java Android example code
7,361 views

double in Java example for Android development

Java double is 64 bit double precision type used when fractional precision calculation is required. Java double je datový typ (reálné číslo) o velikosti 64 bitů. Používá se například pro přesný výsledek po dělení za desetinnou tečkou. Pokud nepotřebuje tak … Continue reading

Posted in Android Examples Code | Tagged , , , | Comments Off on double in Java example for Android development
7,986 views

string in java example

string in java example of use String str = "abc"; char [] chArray ={’a’,’b’,’c’}; String str2 = new String(chArray); // "abc"   String str3 = "Get index of"; // Returns the index within this string of // the first occurrence … Continue reading

Posted in Android Examples Code | Tagged , , | Comments Off on string in java example