js sale calculator