Ccur function

D

Dan

I am using the Ccur function to convert a number to a
currency type. It works fine except in the cases where the
number is negative. Is there a way to get a negative
currency value?
 
G

Guest

Correction:

The case it fails on is this Ccur( 0 & [number] ). If the
field is blank...make it $0.00, else make it $number.
Fails when [number] is negative
 
J

John Nurick

This is because
0 & -1
produces
"0-1"
which CCur() doesn't recognise as a number. Use Nz([Number], 0) instead.

Correction:

The case it fails on is this Ccur( 0 & [number] ). If the
field is blank...make it $0.00, else make it $number.
Fails when [number] is negative
-----Original Message-----
I am using the Ccur function to convert a number to a
currency type. It works fine except in the cases where the
number is negative. Is there a way to get a negative
currency value?
.
 
G

Gary Walter

Correction:

The case it fails on is this Ccur( 0 & [number] ). If the
field is blank...make it $0.00, else make it $number.
Fails when [number] is negative
-----Original Message-----
I am using the Ccur function to convert a number to a
currency type. It works fine except in the cases where the
number is negative. Is there a way to get a negative
currency value?
.
Hi Dan,

I have used this "method" with CDec(),
but it would fail if "0" was first in order.

float = 1.3
?CDec(0 & float) <--works when postive
1.3

float = -1.3
?CDec(0 & float) <--does not work


?CDec(float & 0) <--WORKS
-1.3

float = null
?CDec(float & 0)
0

same is true for CCur()

float = -1.3
?CCur(float & 0)
-1.3

Good luck,

Gary Walter
 
G

Gary Walter

John Nurick said:
But
float = -1.0
?CCur(float & 0)
-10
!
So I guess you're saying that a company that
wants to stay in business should use NZ when
it computes it's discounts? :cool:

Thanks John and apologies Dan.
 
J

J.TOLUM

Dan said:
I am using the Ccur function to convert a number to a
currency type. It works fine except in the cases where the
number is negative. Is there a way to get a negative
currency value?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top