Subject |
Re: leading zero |
From |
Ken Mayer <dbase@nospam.goldenstag.net> |
Date |
Thu, 23 Apr 2015 11:21:27 -0700 |
Newsgroups |
dbase.getting-started |
On 4/23/2015 11:09 AM, eric wu wrote:
> what is the best easy way to covert a number with leading zero ?
>
> f.e. setup length to 5 , convert 123 to '00123'
The field would need to be character to have leading zeroes. If you just
want to display it with leading zeroes:
? str( 123, 5, 0, "0" )
parameters: value to convert, length, number of decimals, padding
character ...
>
> the best easy to convert date {04/22/2015} to '2015-04-22' ?
There are a ton of utilities out there for dealing with converting date
formats. You can write your own, or check the dUFLP, which has
"DateEx.cc" -- a class for doing HUGE amounts of manipulation of dates,
including using different formats.
You might also look at some of the settings in dBASE itself.
Ken
--
*Ken Mayer*
Ken's dBASE Page: http://www.goldenstag.net/dbase
The dUFLP: http://www.goldenstag.net/dbase/index.htm#dUFLP
dBASE Books: http://www.goldenstag.net/dbase/dBASEBooks.htm
|
|