Rick Faircloth wrote:
> 
> 1.  dB column is defined as "decimal(10,2)NOT NULL"

>       update accounts
>       set balance = <cfqueryparam cfsqltype="cf_sql_decimal"
> value="#LSParseNumber(current_balance)#">
>       where account_id = '#get_accounts.account_id#'
> 
>     Would this cause the "balance" column variable to come
>     an integer?

No, it would cause the balance column variable to become a decimal with 
a scale of 0 (which in CF is not distinguishable from an integer). Use 
the scale attribute of cfqueryparam.



> (The code below adds up the current balances in the expense accounts as 
> "total_expense")
> 
> select sum(monthly_expense) as total_expense from accounts where account_type 
> = 'Expense'

Looks OK.


> (This code takes a current account balance (stored as decimal 10, 2) and
> calculates what percentage of "total_expense" is in the budget expense 
> accounts.)
>       
> <cfset new_amount = get_accounts.balance
> + ((get_accounts.monthly_expense/get_total_expense.total_expense)
> *#LSParseCurrency(form.trans_amount)#)>

Use PrecisionEvaluate() to do exact math.

Jochem

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Enterprise web applications, build robust, secure 
scalable apps today - Try it now ColdFusion Today
ColdFusion 8 beta - Build next generation apps

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:292512
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to