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:

Feature request for next version (2005) OS X problem: when using [ShowCart] or [orderfile]... (2000) html pages not working (2003) Repeating Fields (1997) [numfound] within summ=t ??? (2000) ErrorMessage.db and redirect URL (1998) Online Docs? (1997) WebCatalog for Postcards ? (1997) Signal Raised Error (1997) Sorting Results (1999) Attn: Bug in GeneralStore example b15 (1997) [WebDNA] TLS 1.2 and [tcpconnect] URGENT (2018) Exclamation point (1997) DocNote#2 - Random info is still wrong ... (2000) Another OS 10.3 Upgrade issue (2004) wierd [cart] action! (1997) Experience with creating real dynamic solutions?????? (1998) Running _every_ page through WebCat ? (1997) Wanted: More Math Functions (or, Can You Solve This?) (1997) Sitebuilder (2004)