Re: Roundup

This WebDNA talk-list message is from

2001


It keeps the original formatting.
numero = 36561
interpreted = N
texte = Assuming all your original numbers have two digits after the decimal point:[text]originalNumber=65.13[/text] [text]noLastDigit=[getchars start=2&from=end][originalNumber][/getchars][/text] [text]lastDigit=[getchars start=1&end=1&from=end][originalNumber][/getchars][/text][showif 0=[lastDigit]] [text]newNumber=[originalNumber][/text] [/showif][showif 5=[lastDigit]] [text]newNumber=[originalNumber][/text] [/showif][showif a1234^[lastDigit]] [text]newNumber=[noLastDigit]5[/text] [/showif][showif a6789^[lastDigit]] [text]newNumber=[math][noLastDigit]+1[/math]0[/text] [/showif]The new value is [newNumber] >Has any Webcater out there worked around rounding up to the .05? > >I have some calucations which come out as 65.13. What I need is to have to >round up or down. Here in Switzerland we usually dont use the 1 cent, 2 >cent, etc. We round everything up or down. > >Everything below 5 is rounded down and everything above up. So 65.13 should >acutally show 63.10 and 63.17 should be 63.20. > >Trying ceil and floor does not help because it rounds the whole int and not >only the .05 part. Any work arounds? > >Sincerely, >Nitai Aventaggiato > >-- >We make tools to energize your business >Content Management & eBusiness Systems > >ComputerOil GmbH http://computeroil.com >Hauptstrasse 12 info@computeroil.com >8252 Schlatt/Switzerland >Tel: +41 (0)52 654 15 55 > > >------------------------------------------------------------- >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://search.smithmicro.com/ ================================================= Kenneth Grome WebDNA Consultant telephone number: 011 63 32 486-9077 telephone number: 011 63 919 749-0060 business web site: http://webdna.net personal web site: http://kengrome.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://search.smithmicro.com/ Associated Messages, from the most recent to the oldest:

    
  1. Re: Roundup (Nitai @ ComputerOil 2001)
  2. Re: Roundup (Peter Werno 2001)
  3. Re: Roundup (Will Starck 2001)
  4. Re: Roundup (Kenneth Grome 2001)
  5. Re: Roundup (Brian Fries 2001)
  6. Roundup (Nitai @ ComputerOil 2001)
  7. Re: Roundup function? (Grant Hulbert 1997)
  8. Roundup function? (w curt eggemeyer 1997)
Assuming all your original numbers have two digits after the decimal point:[text]originalNumber=65.13[/text] [text]noLastDigit=[getchars start=2&from=end][originalNumber][/getchars][/text] [text]lastDigit=[getchars start=1&end=1&from=end][originalNumber][/getchars][/text][showif 0=[lastDigit]] [text]newNumber=[originalNumber][/text] [/showif][showif 5=[lastDigit]] [text]newNumber=[originalNumber][/text] [/showif][showif a1234^[lastDigit]] [text]newNumber=[noLastDigit]5[/text] [/showif][showif a6789^[lastDigit]] [text]newNumber=[math][noLastDigit]+1[/math]0[/text] [/showif]The new value is [newNumber] >Has any Webcater out there worked around rounding up to the .05? > >I have some calucations which come out as 65.13. What I need is to have to >round up or down. Here in Switzerland we usually dont use the 1 cent, 2 >cent, etc. We round everything up or down. > >Everything below 5 is rounded down and everything above up. So 65.13 should >acutally show 63.10 and 63.17 should be 63.20. > >Trying ceil and floor does not help because it rounds the whole int and not >only the .05 part. Any work arounds? > >Sincerely, >Nitai Aventaggiato > >-- >We make tools to energize your business >Content Management & eBusiness Systems > >ComputerOil GmbH http://computeroil.com >Hauptstrasse 12 info@computeroil.com >8252 Schlatt/Switzerland >Tel: +41 (0)52 654 15 55 > > >------------------------------------------------------------- >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://search.smithmicro.com/ ================================================= Kenneth Grome WebDNA Consultant telephone number: 011 63 32 486-9077 telephone number: 011 63 919 749-0060 business web site: http://webdna.net personal web site: http://kengrome.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://search.smithmicro.com/ Kenneth Grome

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:

Credit Card not accepted (1998) Mozilla/4. and Browser Info.txt (1997) Generating Options for a Form. (1997) Code database (1998) SOP for WebDNA talk (2004) Email Newsletters (2003) File Upload (1997) Sub Totals (2000) same product in cart (1997) [MOVEFILE] question (2004) Math problems (1998) Install webcat on intel/linux box. (2000) bug in [SendMail] (1997) Auto Delete EmailCompleted Files (2002) Help name our technology! (1997) Fwd: Bug at start of Apache 2 with iTools 7 (2003) CERT Advisory on malicious scripts (2000) total number of matches (1999) WebCat2 several catalogs? (1997) WebCat2: Items xx to xx shown, etc. (1997)