I need to make a program that find the minimum difference of an array of float by sorting it first. The problem is the Scanner wont take period (.) as a decimal point (for example if i input 2.251 it will read it as 2251.0). Here is a part of the code
import java.util.Scanner;
public class Selisih {
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int m = sc.nextInt();
float[] arr = new float[m];
for(int i = 0; i < m; i++){
arr[i] = sc.nextFloat();
}
quickSort(arr, 0, m - 1);
System.out.printf("%.3f", minDiff(arr));
}