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:

[WebDNA] Receive JSON POST (2019) Cross platform problem with Convertchars (2002) Mail Server Needed. (1998) db merge problem (2002) Special delete ... (1997) Bad File: DeleteCommand.html (1998) [OT] Multi - Language (2007) (1998) WC2b15 File Corruption (1997) A zip code search (1998) Multiple fields on 1 input (1997) question... no field names? (2002) European Dates (1998) WebCat2b15MacPlugIn - [authenticate] not [protect] (1997) Server slowing down. (1997) [WebDNA] another test post (2014) RE: [WebDNA] Grep (2009) Sku numbers (1997) Shopping Cart ID (1998) Replace context problem ... (1997)