Re: Round to the nearest half!

This WebDNA talk-list message is from

2008


It keeps the original formatting.
numero = 69788
interpreted = N
texte = [MATH]([Format .0f][MATH]([myValue]+0.0000001)*2[/MATH][/Format])/2[/=20 MATH] Change "+0.0000001" to smaller number if your [myValue] has more than =20= six decimals. Best, Christer ************************************************************* Christer Olsson PO Box 9160 Phone +46 40 25 85 85 Ljusa Id=E9er AB SE-200 39 Malmo Fax +46 40 25 85 89 Kantyxegatan 5 Sweden http://www.ljusaideer.se 8 feb 2008 kl. 20.25 skrev Donovan Brooke: > Hello, > > I am trying to round to the nearest .5 increment and > my code so far is too long winded. Here is your mission > should you choose to accept it: > > Round to the nearest half.. so: > > 1.6543 > > Should return as 1.5 > > If the number is absolutely between a half increment.. such > as in: 1.75, it should round up (becoming 2 in this case). > > Thanks, > Donovan > > > --=20 > =3Do=3Do=3Do=3Do=3Do=3Do=3Do=3Do=3Do=3Do=3Do=3Do=3Do=3Do=3Do=3Do=3Do=3D= o=3Do=3Do=3Do=3Do=3Do=3Do=3Do > DONOVAN D. BROOKE EUCA Design Center > <- Web Development (specializing in eCommerce),-> > <- Desktop Publishing, Print Consulting, Labels -> > <-Glass Products, off-hand Classes/studio rental-> > PH:>(608) 770-3822 > TALK:>http://artglass-forum.com > WEB:> http://www.euca.us & http://www.egg.bz > =3Do=3Do=3Do=3Do=3Do=3Do=3Do=3Do=3Do=3Do=3Do=3Do=3Do=3Do=3Do=3Do=3Do=3D= o=3Do=3Do=3Do=3Do=3Do=3Do=3Do > > ------------------------------------------------------------- > This message is sent to you because you are subscribed to > the mailing list . > To unsubscribe, E-mail to: > To switch to the DIGEST mode, E-mail to = > > Web Archive of this list is at: http://webdna.smithmicro.com/ ------------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://webdna.smithmicro.com/ Associated Messages, from the most recent to the oldest:

    
  1. Re: Round to the nearest half! ( Donovan Brooke 2008)
  2. Re: Round to the nearest half! ( Christer Olsson 2008)
  3. Re: Round to the nearest half! ( Matthew A Perosi 2008)
  4. Re: Round to the nearest half! ( Donovan Brooke 2008)
  5. Re: Round to the nearest half! ( Matthew A Perosi 2008)
  6. Round to the nearest half! ( Donovan Brooke 2008)
[math]([Format .0f][math]([myValue]+0.0000001)*2[/MATH][/Format])/2[/=20 MATH] Change "+0.0000001" to smaller number if your [myValue] has more than =20= six decimals. Best, Christer ************************************************************* Christer Olsson PO Box 9160 Phone +46 40 25 85 85 Ljusa Id=E9er AB SE-200 39 Malmo Fax +46 40 25 85 89 Kantyxegatan 5 Sweden http://www.ljusaideer.se 8 feb 2008 kl. 20.25 skrev Donovan Brooke: > Hello, > > I am trying to round to the nearest .5 increment and > my code so far is too long winded. Here is your mission > should you choose to accept it: > > Round to the nearest half.. so: > > 1.6543 > > Should return as 1.5 > > If the number is absolutely between a half increment.. such > as in: 1.75, it should round up (becoming 2 in this case). > > Thanks, > Donovan > > > --=20 > =3Do=3Do=3Do=3Do=3Do=3Do=3Do=3Do=3Do=3Do=3Do=3Do=3Do=3Do=3Do=3Do=3Do=3D= o=3Do=3Do=3Do=3Do=3Do=3Do=3Do > DONOVAN D. BROOKE EUCA Design Center > <- Web Development (specializing in eCommerce),-> > <- Desktop Publishing, Print Consulting, Labels -> > <-Glass Products, off-hand Classes/studio rental-> > PH:>(608) 770-3822 > TALK:>http://artglass-forum.com > WEB:> http://www.euca.us & http://www.egg.bz > =3Do=3Do=3Do=3Do=3Do=3Do=3Do=3Do=3Do=3Do=3Do=3Do=3Do=3Do=3Do=3Do=3Do=3D= o=3Do=3Do=3Do=3Do=3Do=3Do=3Do > > ------------------------------------------------------------- > This message is sent to you because you are subscribed to > the mailing list . > To unsubscribe, E-mail to: > To switch to the DIGEST mode, E-mail to = > > Web Archive of this list is at: http://webdna.smithmicro.com/ ------------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://webdna.smithmicro.com/ Christer Olsson

DOWNLOAD WEBDNA NOW!

Top Articles:

Talk List

The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...

Related Readings:

Multiple prices (1997) TCP Connect (2003) Setting up shop (1997) Authorize.net setup (2002) serial number dishing (1997) searches with dash, period etc. (back form politeness) (2000) shipping costs (1997) emailer (1997) Re:no [search] with NT (1997) HELP - NONE STOP DIGESTS. Digest for 4/24/97) (1997) Search in 2 or more catalogs (1997) newbies to web, spaces in email address (1998) WebDNA version? (2007) [showif] or-ing (1999) Odd [math] behaviour (2003) Various Problems (1997) Web Catalog not encrypting/decrypting problem (1998) Multiple Selections in Pull-Down Menu (2000) emailer (1997) WCS Newbie question (1997)