Yes, I worked it out something like this:
Dim theStringToDisplay as String = "######." + "0".PadRight(myPrecision,
"0"c)
So I have a variable "displayed decimal places" according to the value of
the precision column in the database ( there is a column called [Precision]
(a tinyint) that tells me how many decimal places the user wants with his
value - we use this because I am sending up values to another piece of
custom hardware which requires this information).
Thanks.
"Chris, Master of All Things Insignificant" <chris@No_Spam_Please.com> wrote
in message news:%2****************@TK2MSFTNGP12.phx.gbl...
When you say "My "displayed decimal places" is a field" what are you
displaying it in? A datagrid or a textbox? The formatting of the display
on the client has nothing to do with the database. Look at the
String.Format command if using a textbox. If you are using a datagrid
there is a format property on the DataGridTextBoxColumn object that will
format the display. The display format string you are looking for is
"0.0000"
Hope it helps
Chris
"Robin Tucker" <id*************************@reallyidont.com> wrote in
message news:cu*******************@news.demon.co.uk... I'm using SQL Server. I don't mean precision, I mean "displayed decimal
places". My "displayed decimal places" is a field, when its 2, I just
want to show aa.bb, when its 3, aa.bbb (or aaaaaaaaaa.bbb) etc. Sure
this is probably quite simple using "Format"?
"JohnFol" <Ou************@WibbleObbble.Com> wrote in message
news:ZX*****************@newsfe5-gui.ntli.net... Precision isn't necessarily the same as decimal places. What db is it?
SQL / Oracle / Jet?
"Robin Tucker" <id*************************@reallyidont.com> wrote in
message news:cu*******************@news.demon.co.uk...
My database has a [Precision] column for numeric data items. How can I
use this number in the "format" command, such that for, say precision
2, I get numbers like 2011.01 or 2387.00 and for 4 I would get
2011.0100 or 2387.0000?
(simple question I know!)