update based upon marcelkas comments - renamed variables, number-formating function replaced with one from intl