Re: [WebDNA] Formatting numbers - truncation instead of rounding

This WebDNA talk-list message is from

2011


It keeps the original formatting.
numero = 107468
interpreted = N
texte = Diane Blackmore wrote: > Hi > > Can anyone tell me the best way to truncate a number using [format] rather than having it round up/down. > > Eg. I have 178.9964 as a value, and I need 178.99 as the outcome > > Obviously using [format .2f][value][/format] will round this to 179.00, so I need another method. > > > Thanks all, Here is my quick skin-the-cat attempt. [getchars start=2&from=end][format .3f]178.9964[/format][/getchars] Donovan -- Donovan Brooke Euca Design Center www.euca.us www.keepitturning.co Associated Messages, from the most recent to the oldest:

    
  1. Re: [WebDNA] Formatting numbers - truncation instead of rounding (sgbc cebu 2011)
  2. Re: [WebDNA] Formatting numbers - truncation instead of rounding (Donovan Brooke 2011)
  3. Re: [WebDNA] Formatting numbers - truncation instead of rounding (Govinda 2011)
  4. [WebDNA] Formatting numbers - truncation instead of rounding (Diane Blackmore 2011)
Diane Blackmore wrote: > Hi > > Can anyone tell me the best way to truncate a number using [format] rather than having it round up/down. > > Eg. I have 178.9964 as a value, and I need 178.99 as the outcome > > Obviously using [format .2f][value][/format] will round this to 179.00, so I need another method. > > > Thanks all, Here is my quick skin-the-cat attempt. [getchars start=2&from=end][format .3f]178.9964[/format][/getchars] Donovan -- Donovan Brooke Euca Design Center www.euca.us www.keepitturning.co Donovan Brooke

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:

RE: Include (1998) Chown www:wheel Almost There WebCat 5 on itools 7 (2003) Return records from another (1997) ShoppingCarts and Sandboxes (2003) WebCatalog/WebMerchant Manuals Available (1998) [WebDNA] LinkedIn Network (2008) WebMerchant MacAuthorize Hub (1999) Count regular expressions in a file (2007) Bug Report, maybe (1997) carriage returns in data (1997) simple forum/bboard (2004) Problems appending to database (1997) [WebDNA] IP Address to country (2008) is there a global includes directory? (1998) Time sort - Flushdatabases (2000) multiple product databases (1997) AOL and [referrer] (2001) Document Contains No Data! (1997) [listfields] on Mac OS w/WC 3.x (2001) Email notification to one of multiple vendors ? (1997)