Re: [WebDNA] math and blank /no value

This WebDNA talk-list message is from

2014


It keeps the original formatting.
numero = 111433
interpreted = N
texte = --Apple-Mail=_2D022446-880E-49C1-B75A-0F26312C9638 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=iso-8859-1 This will fix your problem: [text show=3DF]totalcharges=3D[math][FORMAT = .2f][ad_listing_price][/FORMAT]+[FORMAT = .2f][promo_topspot_price][/FORMAT]+[FORMAT = .2f][photo_update_price][/FORMAT][/math][/text] If any of your values are blank they will be formatted to 0.00 so that = your math will then be able to calculate without error. Regards Stuart Tremain IDFK Web Developments AUSTRALIA webdna@idfk.com.au On 6 Jul 2014, at 1:57 am, Rich Kwas wrote: > Hope everyone in the US had a nice 4th of July..... > Chicago stopped its lakefront fireworks extravaganza years ago.... ;( >=20 >=20 > A somewhat simple [math] addition snippet is driving me nuts >=20 > I've seen this referenced one way or another in the talklists..... >=20 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > Another trick for dealing with fields that may be blank is to prepend=20= > them with a 0 within the math = context:[math][_itemamount]+[_postage]+0[_donation][/math] > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >=20 >=20 > Doesn't behave as mentioned that way for me..... >=20 >=20 > I'm ultimately snatching some price values and doing simple addition: >=20 > [text = show=3DF]totalcharges=3D[math][ad_listing_price]+[promo_topspot_price]+[ph= oto_update_price][/math][/text] >=20 > (there will be many more fields, but for now I'm just dealing with = those 3) >=20 > If any one of those 3 price variables is not passed from the form the = addition will not happen. > If all 3 are passed they total up just fine.=20 > There might be as many as 13 fields getting totaled up when complete. > There might be just one price to pass along, maybe 2 or 3 to add up, = maybe 4 or 5 etc >=20 > Adding a "0" like mentioned in the talklist entries I've found does = nothing. >=20 > I've used [listvariables] and [formvariables] to be sure those 3 = prices are being passed around OK and they are.... >=20 >=20 > Something simple I'm missing or flying over my head? >=20 > Adding [hideif]s into that [math] part is an option, but looking for a = simpler solution. >=20 > I'm running version 6.2 on Windows Server2008 >=20 > Searching the newer talklist gets a little clunky at times using that = form..... >=20 >=20 >=20 >=20 > =20 > --------------------------------------------------------- This message = is sent to you because you are subscribed to the mailing list . To = unsubscribe, E-mail to: archives: = http://mail.webdna.us/list/talk@webdna.us Bug Reporting: = support@webdna.us --Apple-Mail=_2D022446-880E-49C1-B75A-0F26312C9638 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=iso-8859-1 This = will fix your problem:

[text show=3DF]totalcharges=3D[math][FORMAT = .2f][ad_listing_price][/FORMAT]+[FORMAT .2f][promo_topspot_price][/FORMAT]+[FORMAT .2f][photo_update_price][/FORMAT][/math][/text]

If any of your values are blank they will be formatted = to 0.00 so that your math will then be able to calculate without = error.

Regards

Stuart = Tremain
IDFK Web Developments
AUSTRALIA




On 6 Jul 2014, at 1:57 am, Rich Kwas <richkwasniewski@yahoo.com>= ; wrote:

Hope = everyone in the US had a nice 4th of July.....
Chicago stopped its lakefront fireworks extravaganza years = ago.... ;(


A somewhat simple [math] addition snippet is driving me = nuts

I've seen this referenced one way or another in the = talklists.....

=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
Another trick for = dealing with fields that may be blank is to prepend 
them with a 0 within the math context:[math][_itemamount]+[_postage]+0[_donation][/math]
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D


Doesn't behave as mentioned = that way for me.....


I'm ultimately snatching some = price values and doing simple addition:

[text = show=3DF]totalcharges=3D[math][ad_listing_price]+[promo_topspot_price]+[photo_update_pr= ice][/math][/text]

(there will be many more fields, but for now = I'm just dealing with those 3)

If any one of those 3 price variables is not = passed from the form the addition will not happen.
If all 3 are passed they = total up just fine. 
There might be as many as 13 fields getting totaled up when = complete.
There might be just one price to pass along, maybe 2 or 3 to = add up, maybe 4 or 5 etc

Adding a "0" like mentioned in the talklist = entries I've found does nothing.

I've used [listvariables] and [formvariables] = to be sure those 3 prices are being passed around OK and they = are....


Something simple I'm missing or flying over my = head?

Adding [hideif]s = into that [math] part is an option, but looking for a simpler = solution.

I'm running = version 6.2 on Windows Server2008

Searching the newer = talklist gets a little clunky at times using that form.....




 
--------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: archives: http://mail.webdna.us/l= ist/talk@webdna.us Bug Reporting: support@webdna.us

= --Apple-Mail=_2D022446-880E-49C1-B75A-0F26312C9638-- Associated Messages, from the most recent to the oldest:

    
  1. Re: [WebDNA] math and blank /no value (=?utf-8?Q?iPhonzie=40G?= 2014)
  2. Re: [WebDNA] math and blank /no value (Kenneth Grome 2014)
  3. Re: [WebDNA] math and blank /no value (Rich Kwas 2014)
  4. Re: [WebDNA] math and blank /no value (Stuart Tremain 2014)
  5. [WebDNA] math and blank /no value (Rich Kwas 2014)
--Apple-Mail=_2D022446-880E-49C1-B75A-0F26312C9638 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=iso-8859-1 This will fix your problem: [text show=3DF]totalcharges=3D[math][FORMAT = .2f][ad_listing_price][/FORMAT]+[FORMAT = .2f][promo_topspot_price][/FORMAT]+[FORMAT = .2f][photo_update_price][/FORMAT][/math][/text] If any of your values are blank they will be formatted to 0.00 so that = your math will then be able to calculate without error. Regards Stuart Tremain IDFK Web Developments AUSTRALIA webdna@idfk.com.au On 6 Jul 2014, at 1:57 am, Rich Kwas wrote: > Hope everyone in the US had a nice 4th of July..... > Chicago stopped its lakefront fireworks extravaganza years ago.... ;( >=20 >=20 > A somewhat simple [math] addition snippet is driving me nuts >=20 > I've seen this referenced one way or another in the talklists..... >=20 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > Another trick for dealing with fields that may be blank is to prepend=20= > them with a 0 within the math = context:[math][_itemamount]+[_postage]+0[_donation][/math] > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >=20 >=20 > Doesn't behave as mentioned that way for me..... >=20 >=20 > I'm ultimately snatching some price values and doing simple addition: >=20 > [text = show=3DF]totalcharges=3D[math][ad_listing_price]+[promo_topspot_price]+[ph= oto_update_price][/math][/text] >=20 > (there will be many more fields, but for now I'm just dealing with = those 3) >=20 > If any one of those 3 price variables is not passed from the form the = addition will not happen. > If all 3 are passed they total up just fine.=20 > There might be as many as 13 fields getting totaled up when complete. > There might be just one price to pass along, maybe 2 or 3 to add up, = maybe 4 or 5 etc >=20 > Adding a "0" like mentioned in the talklist entries I've found does = nothing. >=20 > I've used [listvariables] and [formvariables] to be sure those 3 = prices are being passed around OK and they are.... >=20 >=20 > Something simple I'm missing or flying over my head? >=20 > Adding [hideif]s into that [math] part is an option, but looking for a = simpler solution. >=20 > I'm running version 6.2 on Windows Server2008 >=20 > Searching the newer talklist gets a little clunky at times using that = form..... >=20 >=20 >=20 >=20 > =20 > --------------------------------------------------------- This message = is sent to you because you are subscribed to the mailing list . To = unsubscribe, E-mail to: archives: = http://mail.webdna.us/list/talk@webdna.us Bug Reporting: = support@webdna.us --Apple-Mail=_2D022446-880E-49C1-B75A-0F26312C9638 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=iso-8859-1 This = will fix your problem:

[text show=3DF]totalcharges=3D[math][FORMAT = .2f][ad_listing_price][/FORMAT]+[FORMAT .2f][promo_topspot_price][/FORMAT]+[FORMAT .2f][photo_update_price][/FORMAT][/math][/text]

If any of your values are blank they will be formatted = to 0.00 so that your math will then be able to calculate without = error.

Regards

Stuart = Tremain
IDFK Web Developments
AUSTRALIA




On 6 Jul 2014, at 1:57 am, Rich Kwas <richkwasniewski@yahoo.com>= ; wrote:

Hope = everyone in the US had a nice 4th of July.....
Chicago stopped its lakefront fireworks extravaganza years = ago.... ;(


A somewhat simple [math] addition snippet is driving me = nuts

I've seen this referenced one way or another in the = talklists.....

=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
Another trick for = dealing with fields that may be blank is to prepend 
them with a 0 within the math context:[math][_itemamount]+[_postage]+0[_donation][/math]
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D


Doesn't behave as mentioned = that way for me.....


I'm ultimately snatching some = price values and doing simple addition:

[text = show=3DF]totalcharges=3D[math][ad_listing_price]+[promo_topspot_price]+[photo_update_pr= ice][/math][/text]

(there will be many more fields, but for now = I'm just dealing with those 3)

If any one of those 3 price variables is not = passed from the form the addition will not happen.
If all 3 are passed they = total up just fine. 
There might be as many as 13 fields getting totaled up when = complete.
There might be just one price to pass along, maybe 2 or 3 to = add up, maybe 4 or 5 etc

Adding a "0" like mentioned in the talklist = entries I've found does nothing.

I've used [listvariables] and [formvariables] = to be sure those 3 prices are being passed around OK and they = are....


Something simple I'm missing or flying over my = head?

Adding [hideif]s = into that [math] part is an option, but looking for a simpler = solution.

I'm running = version 6.2 on Windows Server2008

Searching the newer = talklist gets a little clunky at times using that form.....




 
--------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: archives: http://mail.webdna.us/l= ist/talk@webdna.us Bug Reporting: support@webdna.us

= --Apple-Mail=_2D022446-880E-49C1-B75A-0F26312C9638-- Stuart Tremain

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:

Sorting by date (1997) WebCatalog for Postcards ? (1997) Bug or syntax error on my part? (1997) cart (1997) WCS Newbie question (1997) OBDC Support (1997) [LOOKUP] (1997) raw field names (2001) A few questions. . . (1997) Access Denied! But why? (1997) Image maps/Webcat (1997) OT: Need some feedback, please. (2003) Searching multiple fields from one form field (1997) off topic fetch vs PCS photomaster (1997) Banners and sort of random display (1997) Special characters in field names (1998) encripted storage (1998) WebCat2 - [format thousands] (1997) b12 cannot limit records returned and more. (1997) How do I make this faster???? (2000)