public final static double roundBidAsk(double number, double tick, boolean bid)
  {
	// get rid of trailing 00..001s and 99..99s
	double raw = Math.round((number) * scale);
	long recpTick = Math.round(1 / tick);
	// get back to basis, tricky with the tick size due to floating issues
	raw /= scale * 1 / recpTick;
	// round to direction
	raw = bid ? Math.floor(raw) : Math.ceil(raw);
	return raw / recpTick;
  }