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:

Lookup within a Search (2005) email code (1998) Today's suggestions (1998) What am I missing (1997) All of a Sudden Type 2 errors (1999) Generating Report Totals (1997) Share Snippet? (1999) pop up menu's (1998) Creating main- and sub-category search (1997) WebDNA dying or ... ? (2005) [WebDNA] Mac Mountain Lion installation (2013) WebCatalog2 Feature Feedback (1996) Summ=T Problem (1997) WebCat2b13 Mac plugin - [sendmail] and checkboxes (1997) WC2.0 Memory Requirements (1997) Version 2.0 and 1.6 simultaneous (1997) Too Much Info (1998) POSTing to a secure server ... (2000) X etc.... (1999) creator code (1997)