Source language: Translate to:

Trailing zeros

Questions about our Advanced Database plug-in

Moderator: Neosoft Support

Trailing zeros

Postby Wrangler » Thu Nov 15, 2007 4:31 pm

If a field in db pro is set to currency, why doesn't it display the trailing zeros? 35.70 is 35.7 and 37.00 is 37

Seems it kind of eliminates the use for a currency field to begin with.
Wrangler
--------------
"You never know about a woman. Whether she'll laugh, cry or go for a gun." - Louis L'Amour

Windows 7 Ultimate SP1 64bit
16GB Ram
Asus GTX 950 OC Strix
Software made with NeoBook
http://highdesertsoftware.com
User avatar
Wrangler
 
Posts: 1507
Joined: Thu Mar 31, 2005 11:40 pm
Location: USA

Postby Gaev » Thu Nov 15, 2007 6:26 pm

Wrangler:
If a field in db pro is set to currency, why doesn't it display the trailing zeros? 35.70 is 35.7 and 37.00 is 37
When you define field types (with the dbpCreateTable command), it only defines the amount of space (on disk) to be allocated .. and how its contents are to be interpreted ... from the Help file ...
Code: Select all
Integer
A whole number between –32,768 and 32,767*.
BigInt
A very large whole number between –2,147,483,648 and 2,147,483,647*.
Currency
Monetary values. Accurate to 15 digits to the left of the decimal point and 4 digits to the right. This field type is sometimes called a "Money" field.
Float
Decimal number between 10^28-1 and 10^28-1*.

Seems it kind of eliminates the use for a currency field to begin with.
Note that the Currency field supports upto 4 decimal digits ... although I don't know a single country with 10,000 cents/pence etc. within their dollar/pound/franc/mark etc.

With NeoBook, you define the formatting and edit properties of a field with the dbpSetFieldProperties command ...
Code: Select all
DisplayFormat=value
This option can be used to specify the display format used for date/time and numeric field types. The display format affects the appearance of the field values in both the grid and NeoBook field variables.
... and ...
Code: Select all
Format String of $#.00 will display a Dollar sign to the left of the number and (upto two) extra zeroes added to the right of the decimal.

You may optionally provide different format strings to be used for positive, negative and zero values. Separate the three sections with the pipe (|) character. For example: #.00|(#.00)|None
User avatar
Gaev
 
Posts: 3734
Joined: Fri Apr 01, 2005 7:48 am
Location: Toronto, Canada

Postby Wrangler » Fri Nov 16, 2007 2:45 pm

Format String of $#.00 will display a Dollar sign to the left of the number and (upto two) extra zeroes added to the right of the decimal.


Good one, Gaev. Somehow I missed that part in the help file.

Thanks.
Wrangler
--------------
"You never know about a woman. Whether she'll laugh, cry or go for a gun." - Louis L'Amour

Windows 7 Ultimate SP1 64bit
16GB Ram
Asus GTX 950 OC Strix
Software made with NeoBook
http://highdesertsoftware.com
User avatar
Wrangler
 
Posts: 1507
Joined: Thu Mar 31, 2005 11:40 pm
Location: USA


Return to NeoBookDBPro

Who is online

Users browsing this forum: No registered users and 2 guests