FormatNumber Problem

I'm having a problem with something that I "thought" wouldn't be too difficult.

I have some code that's pulling 2 number columns out of an Excel file, doing a calculation and giving me a result.... No Prob.

The result it's giving me is something like this: 2.89999999999999E-02

I want to format it to 2.899 but formatNumber gives me a type mismatch.

i've tried things like cint & cdbl but with no luck. I get the error Invalid use of Null: 'cdbl'

So I am at a loss, is there anyone that can shed some light on my problem?

View Replies


ADVERTISEMENT

Formatnumber ( 2 -2,- 2, -2, 2)

when i am working with currency or a number and apply the function formatnumber to a recordset or variable. I normally get funny results. e.g.

<%= FormatNumber((users.Fields.Item("purse").Value), 2, -2, -2, -2) %>

I normally get a value such as $ 1.000.000,00 instead of $1,000,000.00. what is wrong here.

View Replies View Related

Round() Vs FormatNumber()

I'm working on finishing a project the was started by someone else who no longer works here. Its an asp page that takes a whack of numbers form a db, and makes em look all pretty in tables. (its a remake of an excel spreadsheet)
the problem is some of the numbers are not apearing properly. I'm thinking it's because they used Round() sometimes and formatNumber() other times.
the question is... do these functions handle numbers differently? i know formatNumber can do more then just round but i just need it to make the numbers 1 or 2 decimals.

View Replies View Related

Formatnumber Function Returns Error

The following code with formatnumber function returns me the following code. Why?

<td align="right"><Font
class=content4><%=formatNumber(ars.Fields("SOLD_AMOUNT"),2)%></td>

Microsoft VBScript runtime error '800a000d'

Type mismatch: 'formatNumber'

View Replies View Related

Using Formatnumber And Response.write Objects

how do i use the function formatnumber and response.write object together. I have a script that checks to see if a record set is empty before using the response.write object.

<% if (ewallet.Fields.Item("purse").Value) <> "" then response.Write(ewallet.Fields.Itempurse").Value)
else
response.Write("Empty")
end if%>

What i need to achieve is to format the "PURSE" field

<% if (ewallet.Fields.Item("purse").Value) <> "" then
response.Write(Formatnumber(ewallet.Fields.Item("purse").Value), -1, -2, -2, -1) else
response.Write("Empty")
end if%>

But this gives an error, when i use both response.write(formatnumber(field_value)).

View Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved