On Thu, Sep 13, 2018 at 11:52 PM Todd Chester <toddandma...@zoho.com> wrote: > > >> Le jeu. 13 sept. 2018 à 23:12, ToddAndMargo <toddandma...@zoho.com > >> <mailto:toddandma...@zoho.com>> a écrit : > >> > > > >> $ p6 'constant c=299792458; say c ~" metres per second";' > >> 299792458 metres per second > >> > >> Hmmmmm. Now I am wondering how to format the > >> commas into the say. > >> > > > > On 09/13/2018 02:43 PM, Laurent Rosenfeld wrote: > > Not very pretty, but this works: > > > > constant c = 299792458; > > say c.flip.subst(/(\d**3)/, {"$0,"}, :g).flip.subst(/^\,/, ""); > > > > Oh Dude!
It's simpler to use comb and join constant c = 299792458; say c.flip.comb(3).join(',').flip;