fixed error while calculate amount, pretiffy js