Link to home
Start Free TrialLog in
Avatar of zillion_kamesh
zillion_kamesh

asked on

currency in indian format

I forgot to mention this, but if you use CStr/ToText to convert the numbers to strings and the numbers can be negative, you'll probably want to do something to handle the formatting for the negative numbers.  It doesn't appear that you can specify how CStr should handle the sign.  It just puts a "-" at the front of the number and it's not a "floating" sign, so there may be a number of spaces between the "-" and the number.  If you just want to remove the extra spaces, you can use Replace () for that.
What is the Solution for this negative numbers.How to use replace function
Avatar of wykabryan
wykabryan
Flag of United States of America image

well replace would be replace(formula,' ','')

but something like this should work

if field > 0 then '-'&Cstr((field*-1)) // or you can use totext(field*-1,'0')
else cstr(field)
Avatar of Mike McCracken
Mike McCracken

Shouldn't the test be < 0

mlmcc
opps.. yeah.. that is what I was thinking but wrote it backwards.
ASKER CERTIFIED SOLUTION
Avatar of James0628
James0628

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
FWIW, the kind of formula that wykabryan suggested won't work in this situation, because you're using a specific format for the conversion and, as a result, you're probably going to have some leading spaces in the converted string.  His suggestion would just put a "-" in front of those spaces, which is what you get now.

 James