You can now convert numbers to strings.
It follows the W3C rules exactly. I did not want to implement it at first, because they are just too silly, but then I was traveling and did not have anything better to do..
The easy case, converting floating point numbers to strings:
query('format-number(7.47, "00.0000000000")')
becomes '07.4700000000'
And you can convert integers, too, which is much more complex:
The simple case
query('format-integer(123, "0")')
becomes '123'
Or with separators
query('format-integer(123, "0-0:0-0:0-0:0-0")')
for '0-0:0-0:0-1:2-3'
Or with other digits
query('format-integer(1234567, "٠")') // ١٢٣٤٥٦٧ (that's arabic-indic)
query('format-integer(1234567, "𝟘")') // ۱۲۳۴۵۶۷ (this too)
query('format-integer(1234567, "𝟘")') // 𝟙𝟚𝟛𝟜𝟝𝟞𝟟
query('format-integer(1234567, "𝟎")') // 𝟏𝟐𝟑𝟒𝟓𝟔𝟕
query('format-integer(1234567, "߀")') // ߁߂߃߄߅߆߇ (this is nko)
query('format-integer(1234567, "೦")') // ೧೨೩೪೫೬೭ (kannada. does not have anything to do with canada)
query('format-integer(1234567, "꧐")') // ꧑꧒꧓꧔꧕꧖꧗ (japanase)
query('format-integer(1234567, "༠")') // ༡༢༣༤༥༦༧ (tibetian)
(edit: seems the forum converts the stranger digits to entities:
http://www.fileformat.info/info/unicode/char/1d7d8/mathematical_doublestruck_digit_zero.png )
but it gets better!
query('format-integer(1234567, "a")') //brfgi (for a table column)
query('format-integer(1234567, "i")') //mmmmm...mdlxvii (roman, with 1234 m's)
query('format-integer(1234567, "w")') //one million two hundred thirty-four thousand five hundred sixty-seven
query('format-integer(1234567, "w;o")') //one million two hundred thirty-four thousand five hundred sixty-seventh (note the th)
query('format-integer(1234567, "Ww", "de")') //Eine Million Zweihundertvierunddreißigtausendfünfhundertsiebenundsechzig (it's German)
query('format-integer(1234567, "Ww;o", "de")') //Eine Million Zweihundertvierunddreißigtausendfünfhundertsiebenundsechzigste (German female number)
query('format-integer(1234567, "Ww;o(-er)", "de")') //Eine Million Zweihundertvierunddreißigtausendfünfhundertsiebenundsechzigster (German male number)
it can handle large numbers too:
query('format-integer(9223372036854775807, "w")') //nine quintillion two hundred twenty-three quadrillion three hundred seventy-two trillion thirty-six billion eight hundred fifty-four million seven hundred seventy-five thousand eight hundred seven
oh, that is tiny. Perhaps this is big?
query('format-integer(1E200, "w")') //one hundred quinquasexagintillion
No, that is still rather small.
Let's go BIG with a factorial:
query('format-integer(x:product(1 to 100000), "w")') //two duoquinquagintacentillinonagintacentillion eight hundred twenty-four duoquinquagintacentillinovemoctogintacentillion two hundred twenty-nine duoquinquagintacentillioctooctogintacentillion four hundred seven duoquinquagintacentilliseptemoctogintacentillion nine hundred sixty duoquinquagintacentillisexoctogintacentillion three hundred forty-seven duoquinquagintacentilliquinquaoctogintacentillion eight hundred seventy-four duoquinquagintacentilliquattoroctogintacentillion two hundred ninety-three duoquinquagintacentillitresoctogintacentillion four hundred twenty-one duoquinquagintacentilliduooctogintacentillion five hundred seventy-eight duoquinquagintacentilliunoctogintacentillion twenty-four duoquinquagintacentillioctogintacentillion five hundred thirty-five duoquinquagintacentillinovenseptuagintacentillion five hundred eighteen duoquinquagintacentillioctoseptuagintacentillion four hundred seventy-seven duoquinquagintacentilliseptenseptuagintacentillion four hundred ninety-four duoquinquagintacentilliseseptuagintacentillion nine hundred twenty-six duoquinquagintacentilliquinquaseptuagintacentillion ninety-one duoquinquagintacentilliquattorseptuagintacentillion two hundred twenty-four duoquinquagintacentillitreseptuagintacentillion eight hundred fifty duoquinquagintacentilliduoseptuagintacentillion five hundred seventy-eight duoquinquagintacentilliunseptuagintacentillion nine hundred eighteen duoquinquagintacentilliseptuagintacentillion eighty-six duoquinquagintacentillinovensexagintacentillion five hundred forty-two duoquinquagintacentillioctosexagintacentillion nine hundred seventy-seven duoquinquagintacentilliseptensexagintacentillion nine hundred fifty duoquinquagintacentillisesexagintacentillion nine hundred one duoquinquagintacentilliquinquasexagintacentillion sixty-three duoquinquagintacentilliquattorsexagintacentillion seventeen duoquinquagintacentillitresexagintacentillion eight hundred seventy-two duoquinquagintacentilliduosexagintacentillion five hundred fifty-one duoquinquagintacentilliunsexagintacentillion seven hundred seventy-one duoquinquagintacentillisexagintacentillion four hundred thirteen duoquinquagintacentillinovenquinquagintacentillion eight hundred thirty-one duoquinquagintacentillioctoquinquagintacentillion one hundred sixty-three duoquinquagintacentilliseptenquinquagintacentillion six hundred ten duoquinquagintacentillisesquinquagintacentillion seven hundred thirteen duoquinquagintacentilliquinquaquinquagintacentillion six hundred eleven duoquinquagintacentilliquattorquinquagintacentillion seven hundred thirty-seven duoquinquagintacentillitresquinquagintacentillion three hundred sixty-one duoquinquagintacentilliduoquinquagintacentillion nine hundred sixty-two duoquinquagintacentilliunquinquagintacentillion nine hundred fifty-one duoquinquagintacentilliquinquagintacentillion four hundred seventy-four duoquinquagintacentillinovenquadragintacentillion nine hundred ninety-six duoquinquagintacentillioctoquadragintacentillion one hundred eighty-three duoquinquagintacentilliseptenquadragintacentillion one hundred twenty-three duoquinquagintacentillisesquadragintacentillion nine hundred eighteen duoquinquagintacentilliquinquaquadragintacentillion twenty-two duoquinquagintacentilliquattorquadragintacentillion seven hundred twenty-six duoquinquagintacentillitresquadragintacentillion seventy-three duoquinquagintacentilliduoquadragintacentillion four hundred nine duoquinquagintacentilliunquadragintacentillion ninety-three duoquinquagintacentilliquadragintacentillion eight hundred thirty-two duoquinquagintacentillinoventrigintacentillion four hundred twenty-two duoquinquagintacentillioctotrigintacentillion five duoquinquagintacentilliseptentrigintacentillion five hundred fifty-six duoquinquagintacentillisestrigintacentillion nine hundred sixty-eight duoquinquagintacentilliquinquatrigintacentillion eight hundred sixty-six duoquinquagintacentilliquattortrigintacentillion seven hundred eighty-four duoquinquagintacentillitrestrigintacentillion thirty-eight duoquinquagintacentilliduotrigintacentillion thirty-seven duoquinquagintacentilliuntrigintacentillion seven hundred thirty-seven duoquinquagintacentillitrigintacentillion nine hundred forty-four duoquinquagintacentillinovemviginticentillion four hundred ninety-six duoquinquagintacentillioctoviginticentillion one hundred twenty-six duoquinquagintacentilliseptemviginticentillion eight hundred thirty-eight duoquinquagintacentillisesviginticentillion fourteen duoquinquagintacentilliquinquaviginticentillion seven hundred eighty-seven duoquinquagintacentilliquattorviginticentillion five hundred eleven duoquinquagintacentillitresviginticentillion one hundred ninety-six duoquinquagintacentilliduoviginticentillion six hundred ninety duoquinquagintacentilliunviginticentillion six hundred thirty-eight duoquinquagintacentilliviginticentillion six hundred four duoquinquagintacentillinovendecicentillion four hundred ninety-two duoquinquagintacentillioctodecicentillion six hundred fourteen duoquinquagintacentilliseptendecicentillion four hundred fifty-three duoquinquagintacentillisedecicentillion eight hundred eleven duoquinquagintacentilliquinquadecicentillion one hundred thirty-seven duoquinquagintacentilliquattordecicentillion nine duoquinquagintacentillitredecicentillion sixteen duoquinquagintacentilliduodecicentillion seventy-six duoquinquagintacentilliundecicentillion six hundred eighty-six duoquinquagintacentillidecicentillion six hundred forty duoquinquagintacentillinovencentillion five hundred forty duoquinquagintacentillioctocentillion seven hundred seventeen duoquinquagintacentilliseptencentillion fifty-six duoquinquagintacentillisexcentillion five hundred ninety-five duoquinquagintacentilliquinquacentillion two hundred twenty-six duoquinquagintacentilliquattorcentillion one hundred twenty-nine duoquinquagintacentillitrescentillion eight hundred four duoquinquagintacentilliduocentillion one hundred ninety-five duoquinquagintacentilliuncentillion eight hundred thirty-five duoquinquagintacentillicentillion six hundred seventy-seven duoquinquagintacentillinovenonagintillion eight hundred ninety duoquinquagintacentillioctononagintillion nine hundred four duoquinquagintacentilliseptenonagintillion seven hundred fifty-four duoquinquagintacentillisenonagintillion one hundred fifty-one duoquinquagintacentilliquinquanonagintillion two hundred eighty-seven duoquinquagintacentilliquattornonagintillion one hundred fourteen duoquinquagintacentillitrenonagintillion eighty-three duoquinquagintacentilliduononagintillion six hundred ninety-two duoquinquagintacentilliunnonagintillion four hundred twenty-five duoquinquagintacentillinonagintillion one hundred fifty-three duoquinquagintacentillinovemoctogintillion five hundred twenty-nine duoquinquagintacentillioctooctogintillion three hundred nine duoquinquagintacentilliseptemoctogintillion six hundred twenty-six duoquinquagintacentillisexoctogintillion sixty-seven duoquinquagintacentilliquinquaoctogintillion two hundred twenty-seven duoquinquagintacentilliquattoroctogintillion one hundred three duoquinquagintacentillitresoctogintillion eight hundred seventy-four duoquinquagintacentilliduooctogintillion four hundred twenty-four duoquinquagintacentilliunoctogintillion six hundred eight duoquinquagintacentillioctogintillion eight hundred sixty-three duoquinquagintacentillinovenseptuagintillion five hundred forty-five duoquinquagintacentillioctoseptuagintillion four hundred thirty-six duoquinquagintacentilliseptenseptuagintillion three hundred ninety-eight duoquinquagintacentilliseseptuagintillion two hundred ninety-three duoquinquagintacentilliquinquaseptuagintillion one hundred seventy-four duoquinquagintacentilliquattorseptuagintillion seven hundred seventy-six duoquinquagintacentillitreseptuagintillion one hundred seventy-seven duoquinquagintacentilliduoseptuagintillion ... four hundred ninety-six octilliduotrigintatrecentillion
It seems the forum does not suppport large numbers. But I have
uploaded the result for you Also, if anyone remembers, the entire point of this library was to be a wrapper around a standard http library that throws an exception on non 2xx error codes.
But sometimes people want to download the actual error page, so the error code behavior is now customizable