Trimming Javascript input (of string type) to include no extra whitespaces in the middle
Using the toFixed() method in JS for formatting numbers upto a specific number of decimal spaces