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

This WebDNA talk-list message is from

2011


It keeps the original formatting.
numero = 107467
interpreted = N
texte = Not sure what is the best/most elegant/shortest way.. but off the top of = my head, quickly without thinking: [ListWords Words=3D178.9964&Delimiters=3D.][if = ("[index]"=3D"1")][then][word][/then][else].[getchars = start=3D1&end=3D2][word][/getchars][/else][/if][/ListWords] -G > Hi >=20 > Can anyone tell me the best way to truncate a number using [format] = rather than having it round up/down. >=20 > Eg. I have 178.9964 as a value, and I need 178.99 as the outcome >=20 > Obviously using [format .2f][value][/format] will round this to = 179.00, so I need another method. >=20 >=20 > Thanks all, >=20 > >=20 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)
Not sure what is the best/most elegant/shortest way.. but off the top of = my head, quickly without thinking: [ListWords Words=3D178.9964&Delimiters=3D.][if = ("[index]"=3D"1")][then][word][/then][else].[getchars = start=3D1&end=3D2][word][/getchars][/else][/if][/ListWords] -G > Hi >=20 > Can anyone tell me the best way to truncate a number using [format] = rather than having it round up/down. >=20 > Eg. I have 178.9964 as a value, and I need 178.99 as the outcome >=20 > Obviously using [format .2f][value][/format] will round this to = 179.00, so I need another method. >=20 >=20 > Thanks all, >=20 > >=20 Govinda

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:

Setting up shop (1997) why do I get authorization requests, even though (1999) newbies to web, spaces in email address (1998) Major Security Hole IIS NT (1998) addlineitem (2000) PSC recommends what date format yr 2000??? (1997) WebCat2b13MacPlugIn - [showif][search][/showif] (1997) I'm new be kind (1997) [shownext max (1997) quotes (2004) Multiple prices (1997) why is authenticate screwing with me today (2002) OT: Microsoft to buy Macromedia? was: [Ignore] Test (2002) SOP for WebDNA talk (2004) Banners (1997) WebCatalog (1999) Hiding HTML and breaking the page (1997) LetterRip and WebCat (1998) Processing all html files through WebCat or Typhoon (1998) WebCat2b13 Mac plugin - [sendmail] and checkboxes (1997)