The draft version of MochiKit.Format.format() and formatter() functions are now ready for testing. They are not documented much, except for my previous email in this thread. And the API shouldn't be considered stable.
So I push the bits into my temporary patch repository instead: http://github.com/cederberg/mochikit-patches/tree/master You can either download a full zip of the patch project there (press the "Download" button). Or you can download just a packed version of MochiKit + Extensions: http://github.com/cederberg/mochikit-patches/tree/master/packed.js?raw=true Or you can browse the source code extensions to MochiKit.Format: http://github.com/cederberg/mochikit-patches/tree/master/MochiKit/Format.js The code should work as per my previous specification, except for bugs and a number of omissions (that I'll probably fix eventually): b - Binary. Outputs the number in base 2. c - Character. o - Octal format. Outputs the number in base 8. x - Hex format. Outputs the number in base 16, using lower-case letters. X - Hex format. Outputs the number in base 16, using upper-case letters. % - Percent conversion for a fixed point number (and adds a '%' char at the end). Cheers, /Per On Fri, Sep 12, 2008 at 7:38 PM, csnyder <[EMAIL PROTECTED]> wrote: > On Fri, Sep 12, 2008 at 1:26 PM, Bob Ippolito <[EMAIL PROTECTED]> wrote: >> >> d is for integers, f is for fixed point. >> >> 1> mochifmt:f("${0:.2f}", [1.234]). >> "$1.23" >> > > Love it. > > Though I finally RTFM'd and found twoDigitFloat(), so this particular > case already sucks less. > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "MochiKit" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/mochikit?hl=en -~----------~----~----~----~------~----~------~--~---
