//Only Allow Numeric Data Types in Hard Drive TextField
txtPurchaseCost.setOnKeyTyped(e -> {
char input = e.getCharacter().charAt(0);
if (Character.isDigit(input) != true) {
e.consume();
}
});
Currently have this code that allows me to only allow numeric values into my TextField. Was wondering how I can make it so I can also allow decimals so the number is in currency format (201.21, 122.00, 12,122.12)
Also thousands separators and only allowing two decimal places would be great but not really important