My understanding of the spec is that the picture string "#,##0.00" should give you a minimum of two digits after the decimal point. It certainly works that way for me in MarkLogic.
fn:format-number(5.6, "#,##0.00") gives "5.60" Are you using a recent version of 4.2? John On 02/09/11 18:31, Lee, David wrote: > I'm trying to figure out fn:format-number > > The specs are about the most confusing thing I've ever read > > http://www.w3.org/TR/xpath-functions-30/#syntax-of-picture-string > > Could someone give me an example that would format a decimal with a > fixed number of 0 padded fraction digits ? > > For example > > format with 2 0 digits padded > > 1 as 1.00 > > 1.4 as 1.40 > > 1.414 as 1.41 > > 0 as 0.00 > > 100.1 as 100.10 > > I've tried both > > "#,##0.##" > > and > > "#,##0.00" > > and both seem to omit the trailing 0 > > Any suggestions ? > > ---------------------------------------- > > David A. Lee > > Senior Principal Software Engineer > > Epocrates, Inc. > > d...@epocrates.com <mailto:d...@epocrates.com> > > 812-482-5224 > -- John Snelson, Senior Engineer http://twitter.com/jpcs MarkLogic Corporation http://www.marklogic.com _______________________________________________ General mailing list General@developer.marklogic.com http://developer.marklogic.com/mailman/listinfo/general