[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index] [Date Index] [Thread Index]
[SQR-USERS Info] [SQRUG Home Page]

RE: [sqr-users] Formatting a number with decimals



I'm not positive on this, but i think its one of two problems.  My money
would be on the first problem.  You're trying to string a number, and
despite the fact that the number itself looks like it has zeros, the
'string' concatenation command is ignoring zeros.  Try concatenating your
line together with

Let $Output_row = $clientacctnum || $lastname || ...etc ||
edit($Balance,'99,999.99') || ...etc

If that doesn't do it, then it might be because excel likes to set their
cells up as 'general', which might be ignoring the extra zeros in the
numbers. (I know it does if the cell only has the number, might do it if its
a number inside text in a general cell).  If you make the cells to be 'text'
format then excel will keep all leading and trailing zeros.  The easiest way
to do this is:

Let $Output_row = $clientacctnum || $lastname || ...etc. || '''' || $Balance
|| '''' || ...etc.  (maybe use the edit($balance, '99,999.99')).

**sidenote**  - Also, if you're trying to get them each to their own column,
I would add a $sepchar in there set to tab over.  ENCODE '<9>' INTO
$SEPCHAR.  Let $Output_row = $clientacctnum || $SEPCHAR || $lastname
....etc.

Hope that helps.



-----Original Message-----
From: sqr-users-bounces+bstone=fastenal.com@sqrug.org
[mailto:sqr-users-bounces+bstone=fastenal.com@sqrug.org]On Behalf Of
Lindquist, Maria
Sent: Thursday, October 21, 2004 1:51 PM
To: This list is for discussion about the SQR database reportinglanguage
from Hyperion Solutions.
Subject: [sqr-users] Formatting a number with decimals


I'm trying to format a number that is written out to a file that is
opened up in Excel. When I do the follwoing string:
 
string $CliAcctNum $LastName $FirstName $Address1 $City1 $State1
$Postal1 
        $SSN  $Phone $Balance $Address2 $City2 $State2 $Postal2 by
$Format into $Output_Row

I want it to include zeros after the decimal point for the variable
$Balance if it is an even number. I have tried Let $Balance =
edit($Balance,'99,999.99') but it still is not bringing in the zeros
after the decimal point. If there are other numbers after the decimal
point it brings in those, but not if it is just zero. Is this possible
at all? Or do I need to tell the user that they will just have to do the
Format Cell thing after running this file to excel?
 
Any suggestions would be greatly appreciated.
 
Thanks!
 
________________________________

Maria K Lindquist
mlindqui@uwc.edu <mailto:mlindqui@uwc.edu> 
IS Programmer/Analyst - Business Office
University of Wisconsin Colleges
780 Regent St, PO Box 8680, Madison, WI  53708-8680
Phone: 608.265.2677 / Fax: 608.265.5770
 <http://www.uwc.edu/images/logo_large.gif> 
 

_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org
http://www.sqrug.org/mailman/listinfo/sqr-users

_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org
http://www.sqrug.org/mailman/listinfo/sqr-users