//Inspired by a good idea of Mr Jens Schwaiger size(8cm,0); string format_(string s, real x, string oldsep=",", string newsep="{,}"){ string s_=format(s, x); if(newsep!=oldsep) s_=replace(s_, oldsep, newsep); return s_; } string format(string, real) = new string(string format, real x) { return format_(format,x); }; string format(real) = new string(real x) { return format_(defaultformat,x); }; include graph; xlimits( -3pi, 3pi); xaxis(BottomTop(), Ticks(Label("$%.2f$",red), Step=2pi,step=pi/5,pTick=.8red));