Subversion Repositories SmartDukaan

Rev

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

Rev 29980 Rev 30034
Line 1... Line -...
1
 
-
 
2
package com.spice.profitmandi.common.util;
1
package com.spice.profitmandi.common.util;
3
 
2
 
4
import java.math.RoundingMode;
3
import java.math.RoundingMode;
5
import java.text.NumberFormat;
4
import java.text.NumberFormat;
6
import java.time.LocalDateTime;
5
import java.time.LocalDateTime;
Line 38... Line 37...
38
	public static String formatYearMonth(LocalDateTime dateTime) {
37
	public static String formatYearMonth(LocalDateTime dateTime) {
39
		return dateTime.format(monYYYYFormatter);
38
		return dateTime.format(monYYYYFormatter);
40
	}
39
	}
41
 
40
 
42
	public static String formatDecimal(double number) {
41
	public static String formatDecimal(double number) {
43
		return numberFormatter.format(number).replace("\\.00", "");
42
		return numberFormatter.format(number).replace(".00", "");
44
	}
-
 
45
 
-
 
46
	public static String formatDecimal(int number) {
-
 
47
		return numberFormatter.format(number).replace("\\.00", "");
-
 
48
	}
-
 
49
 
-
 
50
	public static String formatDecimal(long number) {
-
 
51
		return numberFormatter.format(number).replace("\\.00", "");
-
 
52
	}
43
	}
53
 
44
 
54
	public static String formatDecimal(float number) {
45
	public static String formatDecimal(float number) {
55
		return numberFormatter.format(number).replace("\\.00", "");
46
		return numberFormatter.format(number).replace(".00", "");
56
	}
47
	}
57
 
48
 
58
	public static String formatDigit(float number) {
49
	public static String formatDigit(float number) {
59
		return numberFormatter.format(number).replace("\\.00", "");
50
		return digitFormatter.format(number);
60
	}
51
	}
61
 
52
 
62
	public static String formatDigit(long number) {
53
	public static String formatDigit(long number) {
63
		return numberFormatter.format(number).replace("\\.00", "");
54
		return digitFormatter.format(number);
64
	}
55
	}
65
 
56
 
66
	public static String formatDigit(int number) {
57
	public static String formatDigit(int number) {
67
		return numberFormatter.format(number).replace("\\.00", "");
58
		return digitFormatter.format(number);
68
	}
59
	}
69
 
60
 
70
	public static String formatDigit(double number) {
61
	public static String formatDigit(double number) {
71
		return numberFormatter.format(number).replace("\\.00", "");
62
		return digitFormatter.format(number);
72
	}
63
	}
73
/*
-
 
74
	public String formatDecimal(double amount){
-
 
75
		return numberFormatter.format(amount).replace("\\.00", "");
-
 
76
	}*/
-
 
77
 
64
 
78
	public static String format(LocalDateTime localDateTime) {
65
	public static String format(LocalDateTime localDateTime) {
79
		return localDateTime.format(dateTimeFormatter);
66
		return localDateTime.format(dateTimeFormatter);
80
	}
67
	}
81
 
68
 
82
	public static String formatPrice(double amount) {
69
	public static String formatPrice(double amount) {
83
		return currencyFormatter.format(amount).replace("\\.00", "");
70
		return currencyFormatter.format(amount).replace(".00", "");
84
	}
71
	}
85
 
72
 
86
	public static String formatPrice(float amount) {
73
	public static String formatPrice(float amount) {
87
		return currencyFormatter.format(amount).replace("\\.00", "");
74
		return currencyFormatter.format(amount).replace(".00", "");
88
	}
75
	}
89
 
76
 
90
	public static String formatPrice(int amount) {
77
	public static String formatPrice(int amount) {
91
		return currencyFormatter.format(amount).replace("\\.00", "");
78
		return currencyFormatter.format(amount);
92
	}
79
	}
93
 
80
 
94
	public static String formatPrice(long amount) {
81
	public static String formatPrice(long amount) {
95
		return currencyFormatter.format(amount).replace("\\.00", "");
82
		return currencyFormatter.format(amount);
96
	}
83
	}
97
 
84
 
98
	public static String formatDate(LocalDateTime dateTime) {
85
	public static String formatDate(LocalDateTime dateTime) {
99
		return dateTime.format(dateFormatter);
86
		return dateTime.format(dateFormatter);
100
	}
87
	}