Casting/ Converting a String... 
Author Message
 Casting/ Converting a String...
Could somebody please tell me how to convert a Number to a String
without rounding to 2 decimal places?  I have tried strVal() and
string() but both round.




Sat, 23 Nov 1996 20:29:04 GMT
 Casting/ Converting a String...

: Could somebody please tell me how to convert a Number to a String
: without rounding to 2 decimal places?  I have tried strVal() and
: string() but both round.

Change your default number format.  I think it's something like

setdefaultnumberformat(formatname)

--Kasey Chang



Sun, 24 Nov 1996 12:37:37 GMT
 Casting/ Converting a String...

Quote:


>Subject: Casting/ Converting a String...
>Date: 7 Jun 1994 08:29:04 -0400
>Could somebody please tell me how to convert a Number to a String
>without rounding to 2 decimal places?  I have tried strVal() and
>string() but both round.

Use format().  You can then explicitly set the number of decimal places that
will appear in the string.

                                  \\/
 _I_                             (o o)                            _I_

|   |                                                            |   |
|   |  Robin Bowes                   University College Salford  |   |
|   |  Database Development                      Frederick Road  |   |

|   |  Tel: 44 (0) 61 745 3457                           M6 6PU  |   |
|   |  Fax: 44 (0) 61 736 3596                   United Kingdom  |   |
|___|____________________________________________________________|___|
(___)  Any Paradox for Windows info (ftp sites, mailing lists    (___)
  I    development tools, tech tips, etc.) gratefully received.    I



Sun, 24 Nov 1996 16:45:13 GMT
 Casting/ Converting a String...

 >
 > Could somebody please tell me how to convert a Number to a String
 > without rounding to 2 decimal places?  I have tried strVal() and
 > string() but both round.

Use format, viz: stringvar = format("W12.5",numvar)  ; vary format as required
==============================================================================
             Peter Hyde, South Pacific Information Services Ltd
             Christchurch, New Zealand -- Only a satellite away



Wed, 27 Nov 1996 05:30:54 GMT
 
 [ 4 post ] 

 Relevant Pages 

1. How to cast / convert a string to uniqueidentifier?

2. CASTING/ CONVERTING A STRING...

3. Converting long to string and to convert the unix dates in the string to regular dates

4. Converting long to string and to convert the unix dates in the string to regular dates

5. Convert hex (stored as string) to string?

6. Zero length string converted to single space string.

7. Using CDaoDatabase with Excel file converts string with only spaces to empty string

8. Putting a STRING onto the clipboard/Converting PdoxWin STRING to WINAPI THandle

9. Using Cast to convert Datetime to Int -loosing 2 days

10. CAST and CONVERT in SQL Server CE?

11. DTS - Cast Convert Error

12. Convert or Cast


 
Powered by phpBB® Forum Software