[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Dropping the decimals??

Posted on 2004-10-28
3
Medium Priority
?
174 Views
Last Modified: 2013-12-24
I'm doing a simple math calcuation and for some reason CF is dropping the decimals:

When I output it on the screen, this is what it says:
22222\1000=22
22*10.0000=220

Here is the math:

<cfset price=#form.qty#\1000>#form.qty#\1000=#price#<br>
#price#*#priceperm#=<cfset price=#price#*#priceperm#>#price#<br>

Help! Am I having a brain freeze or something?
0
Comment
Question by:mailershaven
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 8

Expert Comment

by:sigmacon
ID: 12437183
Hi mailershaven,

try

<cfset price=#form.qty# / 1000.00>#form.qty# / 1000.00 =#price#<br>
#price#*#priceperm#=<cfset price=#price#*#priceperm#>#price#<br>


Good luck!
0
 
LVL 8

Accepted Solution

by:
sigmacon earned 2000 total points
ID: 12437200
actually, drop the unneccessary #s

<cfset price= form.qty / 1000.00>#form.qty# / 1000.00 = #price#<br>
#price# * #priceperm# = #price * priceperm#<br> <!--- this works only in MX, not in CF 5 --->

0
 

Author Comment

by:mailershaven
ID: 12437234
definite brain freeze. / :)
0

Featured Post

Enroll in October's Free Course of the Month

Do you work with and analyze data? Enroll in October's Course of the Month for 7+ hours of SQL training, allowing you to quickly and efficiently store or retrieve data. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A web service (http://en.wikipedia.org/wiki/Web_service) is a software related technology that facilitates machine-to-machine interaction over a network. This article helps beginners in creating and consuming a web service using the ColdFusion Ma…
Have you ever sent email via ColdFusion and thought of tracking this mail to capture the exact date and time when the message was opened ?  If yes, then this article is for you ! First we need a table user_email with columns user_id , email , sub…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
Suggested Courses

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question