-
Notifications
You must be signed in to change notification settings - Fork 2
/
FunctionHelper.java
29 lines (24 loc) · 934 Bytes
/
FunctionHelper.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
package com.azhar.donasi.util;
import java.text.DecimalFormat;
import java.text.SimpleDateFormat;
import java.util.Calendar;
/*
* Created by Azhar Rivaldi on 03-11-2023
* Youtube Channel : https://bit.ly/2PJMowZ
* Github : https://github.com/AzharRivaldi
* Twitter : https://twitter.com/azharrvldi_
* Instagram : https://www.instagram.com/azhardvls_
* LinkedIn : https://www.linkedin.com/in/azhar-rivaldi
*/
public class FunctionHelper {
public static String rupiahFormat(int price) {
DecimalFormat formatter = new DecimalFormat("#,###");
return "Rp " + formatter.format(price).replaceAll(",", ".");
}
public static String setDataTime() {
Calendar calendar = Calendar.getInstance();
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("d MMMM yyyy HH:mm:ss");
String formattedDate = simpleDateFormat.format(calendar.getTime());
return formattedDate;
}
}