Dollar edges toward best monthly gain