Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8262667
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T03:49:48+00:00 2026-06-08T03:49:48+00:00

I am having some difficulties understanding how to use comma in format-number in XML.

  • 0

I am having some difficulties understanding how to use comma in format-number in XML.
For example,
<xsl:value-of select="format-number(123456,'####,##')"/>

gives me 12,34,56
But from what I read, the comma is a group separator, so I thought it should have been 1234,56. Clearly, I am understanding it wrong. Can someone explain it to me please?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T03:49:51+00:00Added an answer on June 8, 2026 at 3:49 am

    I can see why you would expect 1234,56, and that’s what I expected too, until I went and looked carefully at the spec. It takes your picture ####,## and calculates the “integer-part-grouping positions” as the list of positions containing a grouping separator in your picture: this list is simply (2). It then says “if these integer-part-grouping-positions are at regular intervals (that is, if they form a sequence N, 2N, 3N, … for some integer value N, including the case where there is only one number in the list), then the sequence [of grouping positions] contains all integer multiples of N as far as necessary to accommodate the largest possible number.”

    So the sequence of grouping positions here ends up being (2,4,6,8,…). The fact that your picture doesn’t have a grouping separator at position 4 doesn’t enter into the rules – it probably should, but it doesn’t. You would have to use a picture like #,################,## to achieve this formatting.

    This is from XSLT 2.0, by the way. The XSLT 1.0 specification defines format-number by reference to the JDK 1.1.8 specification of DecimalFormat, which is extremely difficult to get hold of nowadays; and if memory serves me correctly, it leaves many detailed questions unanswered.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm having some difficulties with a query: SELECT d.*, (SELECT COUNT(id) FROM downloads WHERE
I'm having some difficulties with getting the value of a subclass in a element.
I am having some difficulties with the XML dataype when using $.ajax . I
I asked a question earlier today about singletons, and I'm having some difficulties understanding
I'm having some difficulties understanding how databases and SQL works. I'm trying to update
I'm having some difficulties creating a javascript appointment style calendar. While it does render,
I'm having some difficulties with the following problem: I'm making a little game where
I'm having some difficulties getting the TabActivity to work. Here's the implementation of the
I'm having some difficulties with Ajax.BeginForm I have something like this in a view
I am having some difficulties passing in parameters to my controller. I created an

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.