Subversion Repositories SmartDukaan

Rev

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

Rev 23532 Rev 23539
Line 6... Line 6...
6
import java.util.Locale;
6
import java.util.Locale;
7
 
7
 
8
public class FormattingUtils {
8
public class FormattingUtils {
9
 
9
 
10
	private static Locale indianLocale = new Locale("en", "IN");
10
	private static Locale indianLocale = new Locale("en", "IN");
11
	private static DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd-MM-YYYY HH:mm");
11
	private static DateTimeFormatter dateFormatter = DateTimeFormatter.ofPattern("dd-MM-YYYY");
12
	
12
	
13
	private NumberFormat currencyFormat;
13
	private NumberFormat currencyFormat;
14
	
14
	
15
	public FormattingUtils(){
15
	public FormattingUtils(){
16
		currencyFormat = NumberFormat.getNumberInstance(indianLocale);
16
		currencyFormat = NumberFormat.getNumberInstance(indianLocale);
Line 28... Line 28...
28
	public String formatPrice(double amount){
28
	public String formatPrice(double amount){
29
		return currencyFormat.format(amount);
29
		return currencyFormat.format(amount);
30
	}
30
	}
31
	
31
	
32
	public static String formatDate(LocalDateTime dateTime) {
32
	public static String formatDate(LocalDateTime dateTime) {
33
		DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd-MM-YYYY HH:mm");
-
 
34
		return dateTime.format(formatter);
33
		return dateTime.format(dateFormatter);
35
	}
34
	}
36
	
35
	
37
}
36
}