XML Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreXML Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old March 23rd, 2004, 08:26 AM
dowdie dowdie is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2004
Posts: 3 dowdie User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
remove commas

Hi

Is there any way to remove a comma from a number using xsl ? e.g

I have the following number:
<MonetaryAmount>842,194.0000000</MonetaryAmount>

but want only:
842194.00

Cheers
Damien

Reply With Quote
  #2  
Old March 23rd, 2004, 02:00 PM
jarra jarra is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Location: the Netherlands
Posts: 66 jarra User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 52 m 39 sec
Reputation Power: 5
Hi,

maybe this will help:

http://www.w3schools.com/xsl/func_formatnumber.asp

best,
jarra
__________________
http://www.jarra.nl

Reply With Quote
  #3  
Old March 24th, 2004, 03:30 AM
dowdie dowdie is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2004
Posts: 3 dowdie User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
number-format

Hi jarra


I have tried this and it will not work, it looks like the function is unable to interpret the , and the output when I apply my stylesheet is NaN.......so something like the following will not work, I think:

<xsl:value-of select="format-number(123,000.5566, '######.00')"/>

Reply With Quote
  #4  
Old March 24th, 2004, 03:47 AM
dowdie dowdie is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2004
Posts: 3 dowdie User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
hi

for anyone interested I solved this problem by doing the following:

<xsl:value-of select="format-number(translate(123,555.5566, ',', ''), '.00')"/>


to give the result 123555.55 i.e what I wanted....

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreXML Programming > remove commas


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway