1 package org.kuali.ole.sip2.common;
2
3 import java.util.Currency;
4 import java.util.Locale;
5
6
7
8
9 public class OLESIP2Util {
10
11
12
13
14
15 public static Currency getDefaultCurrency() {
16 return Currency.getInstance(Locale.getDefault());
17 }
18
19
20
21
22
23
24
25 public static String bool2Int(boolean value) {
26 if (value) {
27 return "1";
28 }
29 return "0";
30 }
31
32
33
34
35
36
37
38 public static String bool2Char(boolean value) {
39 if (value) {
40 return "Y";
41 }
42 return "N";
43 }
44
45
46
47
48
49
50
51 public static String bool2CharEmpty(boolean value) {
52 if (value) {
53 return "Y";
54 }
55 return " ";
56 }
57
58
59
60
61
62
63
64
65
66
67 public static String intToFixedLengthString(int value, int length) {
68 return String.format("%0" + length + "d", value);
69 }
70 }