Subversion Repositories eFlore/Applications.del

Rev

Rev 1517 | Rev 1953 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1517 Rev 1833
Line 1... Line 1...
1
package org.tela_botanica.del.client.utils;
1
package org.tela_botanica.del.client.utils;
Line -... Line 2...
-
 
2
 
-
 
3
import com.google.gwt.i18n.client.NumberFormat;
2
 
4
 
Line 3... Line 5...
3
public class StringUtils {
5
public class StringUtils {
4
	
6
	
5
	public static boolean checkStringNotNull(String s){
7
	public static boolean checkStringNotNull(String s){
Line 28... Line 30...
28
	public static native void logChaine(String s) /*-{
30
	public static native void logChaine(String s) /*-{
29
		if(!!($wnd.console && $wnd.console.log)) {
31
		if(!!($wnd.console && $wnd.console.log)) {
30
			$wnd.console.log(s);
32
			$wnd.console.log(s);
31
		}
33
		}
32
	}-*/;
34
	}-*/;
-
 
35
	
-
 
36
	public static String formaterNombre(double valeur, int decimales) {
-
 
37
	    StringBuilder patternNb = new StringBuilder(
-
 
38
	            (decimales <= 0) ? "" : ".");
-
 
39
	    for (int i = 0; i < decimales; i++) {
-
 
40
	    	patternNb.append('0');
-
 
41
	    }
-
 
42
	    
-
 
43
	    if(valeur == 0) {
-
 
44
	    	patternNb.insert(0, 0);
-
 
45
	    }
-
 
46
	    
-
 
47
	    return NumberFormat.getFormat(patternNb.toString()).format(valeur);
-
 
48
	}
33
}
49
}