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 January 19th, 2004, 06:12 PM
wasifali wasifali is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Posts: 2 wasifali User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
how can i convert 77.777777.. to 77.78 through xsl

hi
i m calculating percentages and getting the result with 16 decimal digits .
How can i trim those digits with xsl

example code

<xsl:variable name="percentclassesattended" select="$classesattended*100 div $totalclasses" />

<xsl:value-of select="$percentclassesattended" />

output : 77.7777777777777777 (say)

if any one knows plz help me.
thanx

wasif

Reply With Quote
  #2  
Old January 19th, 2004, 07:15 PM
Culland Culland is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Posts: 38 Culland User rank is Private First Class (20 - 50 Reputation Level)Culland User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 55 m 6 sec
Reputation Power: 6
There is a round function, but it only rounds to the integer, so you need to take your 77.77777 multiply by 100 to give you 7777.777, then round(), then divide by 100 to give you 77.78.

Cul

Reply With Quote
  #3  
Old January 20th, 2004, 03:09 AM
wasifali wasifali is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Posts: 2 wasifali User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thanx a lot Culland
The round () function worked.

Regards
Wasif

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreXML Programming > how can i convert 77.777777.. to 77.78 through xsl


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 1 hosted by Hostway
Stay green...Green IT