String modification to format as a dollar-amount?
This is an open discussion with 3 replies, filed under XSLT.
Search
I know of the format-number()
function natively in XSLT although haven’t used it.
<xsl:value-of select='format-number($number "###,###.00")'/>
Yeah that’s what I use. With the currency value, and allowing for larger numbers, it might look something like this:
<xsl:value-of select="format-number($number,'$#,###,###,###.00')"/>
Worked like a charm! As always thanks for the help!
Create an account or sign in to comment.
I’m creating a timeshare website and for the sake of the ability to filter down results I have all the prices entered as straight numbers, no commas or anything. What I’m hoping is that XSLT has some method that will allow me to format the number.
I seem to remember there being string manipulators but I can’t find them.
All I need it to do is to be able to know where to insert commas in a number that’s 10,000, 1,000 and when not to insert one, such as anything below 1,000.
Any tips or hints?