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

Re: Establishing the floor of a range a number belongs

Subject: Re: Establishing the floor of a range a number belongs to
From: Graydon <graydon@xxxxxxxxx>
Date: Sat, 19 Nov 2011 16:36:17 -0500
Re:  Establishing the floor of a range a number belongs
On Sat, Nov 19, 2011 at 04:21:38PM -0500, Graydon Saunders scripsit:
> On Sat, Nov 19, 2011 at 02:03:25PM -0700, Mark scripsit:
> > I am parsing around 3500 numbers and want to be able to establish
> > the floor of the range each number belongs to. For instance, 326
> > belongs to the range "300-399" and its floor is "300", the value I
> > want. Another example would be 1627, whose range is 1600-1699 and
> > whose floor is 1600. I failed to find the right combination of XPath
> > math functions [mode(), floor()], etc., to do this.
> [snip, yeah, that is indeed painful]
> > What function or combination of functions do I need to accomplish my goal?
> 
> What's wrong with 
> 
> replace(CatNumbers/@scott-number,'\d\d$','00')
> 
> Which will replace the last two digits with zeros?
> 
> Alternatively,
> 
> floor(CatNumbers/@scott-number / 100) * 100

div! div!

floor(CatNumber/@scott-number div 100) * 100

Sorry about that; you won't like what the slash does.

-- Graydon

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.