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

This WebDNA talk-list message is from

2011


It keeps the original formatting.
numero = 107470
interpreted = N
texte = --000e0ce0b1a64076f704af0598a6 Content-Type: text/plain; charset=ISO-8859-1 *Drop-off not Round-off* courtesy from Brian Fries Try this: 178.9964 = [math] [math] ((floor(178.9964*100))/100) [/math] On Mon, Oct 10, 2011 at 5:20 AM, 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, > > > > > > --000e0ce0b1a64076f704af0598a6 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Drop-off not Round-off
courtesy from 3D""= Brian Fries

Try this:

178.9964
=A0=3D
[math]
[math]
((fl= oor(178.9964*100))/100)
[/math]


On= Mon, Oct 10, 2011 at 5:20 AM, Diane Blackmore <diane@cohesion.co.nz> 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,






--000e0ce0b1a64076f704af0598a6-- 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)
--000e0ce0b1a64076f704af0598a6 Content-Type: text/plain; charset=ISO-8859-1 *Drop-off not Round-off* courtesy from Brian Fries Try this: 178.9964 = [math] [math] ((floor(178.9964*100))/100) [/math] On Mon, Oct 10, 2011 at 5:20 AM, 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, > > > > > > --000e0ce0b1a64076f704af0598a6 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Drop-off not Round-off
courtesy from 3D""= Brian Fries

Try this:

178.9964
=A0=3D
[math]
[math]
((fl= oor(178.9964*100))/100)
[/math]


On= Mon, Oct 10, 2011 at 5:20 AM, Diane Blackmore <diane@cohesion.co.nz> 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,






--000e0ce0b1a64076f704af0598a6-- sgbc cebu

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:

Auto SKU's (2000) [WebDNA] [OT] thanks. (2009) WebCat2b12--[searchstring] bug (1997) [WriteFile] problems (1997) [middle] (2000) WebCat & Liststar ... & Rumpus, too! (1997) [SHOWIF] (1997) Searching for a Blank Field (2000) TCP Connect/send and CGI (2003) file upload type restrictions? (2001) using showpage and showcart commands (1996) Help! WebCat2 bug (1997) Search Engines (2000) Security Question (1997) Re:Copyright ? (1997) ECHO Online (2002) AddLineitems - 100 Item Limit? (2002) Separate SSL Server (1997) Occasional crashes with $remove (1997) [WebDNA] read database from other domain (2015)