MainCalculator: refactor code

updated a condition to validatenumberformat to remove '$' & person before checking the input. Correction: updated incorrect method due to which no output was printed.