Subversion Repositories SmartDukaan

Rev

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

Rev 24401 Rev 27870
Line -... Line 1...
-
 
1
 
1
package com.spice.profitmandi.common.util;
2
package com.spice.profitmandi.common.util;
2
 
3
 
3
import java.text.DecimalFormat;
4
import java.text.DecimalFormat;
4
import java.text.NumberFormat;
5
import java.text.NumberFormat;
5
import java.time.LocalDateTime;
6
import java.time.LocalDateTime;
Line 40... Line 41...
40
	
41
	
41
	public static String formatReporitcoDate(LocalDateTime dateTime) {
42
	public static String formatReporitcoDate(LocalDateTime dateTime) {
42
		if(dateTime==null) return "-";
43
		if(dateTime==null) return "-";
43
		return dateTime.format(reporticoFormatter);
44
		return dateTime.format(reporticoFormatter);
44
	}
45
	}
-
 
46
 
-
 
47
	public static String formatShortHand(long value) {
-
 
48
		String finalval = null;
-
 
49
 
-
 
50
		if (value >= 100000 && value < 10000000) {
-
 
51
			long reminder = value / 100000;
-
 
52
			long quitonent = value % 100000;
-
 
53
			finalval = reminder + "." + quitonent;
-
 
54
			String secondval = String.valueOf(quitonent);
-
 
55
			if (secondval.length() >= 2) {
-
 
56
				secondval = secondval.substring(0, 2);
-
 
57
				finalval = reminder + "." + secondval;
-
 
58
			}
-
 
59
			return String.valueOf(finalval) + " Lacs";
-
 
60
		} else if (value >= 1000 && value < 100000) {
-
 
61
			long reminder = value / 1000;
-
 
62
			long quitonent = value % 1000;
-
 
63
			finalval = reminder + "." + quitonent;
-
 
64
			String secondval = String.valueOf(quitonent);
-
 
65
			if (secondval.length() >= 2) {
-
 
66
				secondval = secondval.substring(0, 2);
-
 
67
				finalval = reminder + "." + secondval;
-
 
68
			}
-
 
69
			return String.valueOf(finalval) + " K";
-
 
70
		} else if (value >= 10000000 && value < 1000000000) {
-
 
71
			long reminder = value / 10000000;
-
 
72
			long quitonent = value % 10000000;
-
 
73
			finalval = reminder + "." + quitonent;
-
 
74
			String secondval = String.valueOf(quitonent);
-
 
75
			if (secondval.length() >= 2) {
-
 
76
				secondval = secondval.substring(0, 2);
-
 
77
				finalval = reminder + "." + secondval;
-
 
78
			}
-
 
79
			return String.valueOf(finalval) + " Cr";
-
 
80
		}
-
 
81
		return String.valueOf(finalval);
-
 
82
 
-
 
83
	}
45
}
84
}