[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

go from double to integer OR show just 1 or 0 decimals

Subject: go from double to integer OR show just 1 or 0 decimals
From: Christian Rasmussen <byggemandbob@xxxxxxxxx>
Date: Wed, 27 Jul 2005 23:33:47 +0200
0 decimals
Hi Experts,

I have a som xml like this:


          <gr:ThroughputStructure unitCode="months">
            <gr:InputQuantity>6.00</gr:InputQuantity>
            <gr:OutputQuantity>28.00</gr:OutputQuantity>
          </gr:ThroughputStructure>

The unitCode attribute of ThroughputStructure is enummerations and can
hold one of following values:
- days
- months
- kg
- numbers

The inputQuantity and OutputQuantity is double types, mainly because
of situations where the unitCode is numbers or kg, but if the unitCode
is days or months, there is really no need for two decimals.

What I would like to do is:

make a template that matches InputQuantity and OutputQuantity, and if
the ../ThroughputStructure/@unitCode is months or days, then the
format for the inputQuantity OutputQuantity need just to be integer or
double without decimals (then there should be som round up...new
problem, how is that done?).

Is that possible? Is it possible to round up the decimals and just
show one, or strip them totally, or convert to integer?

Help is very much appreciated :-)

on beforehand, thank you!

/Christian Rasmussen

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.