Re: Formatting number with two decimal places

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Armin Zingler (az.nospam_at_freenet.de)
Date: 04/18/04


Date: Sun, 18 Apr 2004 02:49:11 +0200


"Sandy" <anonymous@discussions.microsoft.com> schrieb
>
> I need to have a value display in a label with two decimal places;
> e.g. "4" to display as "4.00"

dim d as decimal
dim s as string

d = 4
s = d.tostring("0.00")

I assume you store numeric values in numeric variables.

-- 
Armin
How to quote and why:
http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html


Relevant Pages

  • RE: Determining max. length of text that can be entered for anothe
    ... string; the size I get back implies that all of the text in the text box will ... fit into the label box w/o clipping, ... Dim stringFont As New Font ... Microsoft Online Community Support ...
    (microsoft.public.dotnet.framework.windowsforms)
  • Re: Output data from multiple records in a table
    ... > Dim rsR As DAO.Recordset ... > Dim strSQL As String ... > such as display it in a textbox on your form. ...
    (microsoft.public.access.modulesdaovba)
  • Re: Best Method
    ... dim dcfirstcolumn as new datacolumn ... >> first field would be a string... ... > Private _Label As String = String.Empty ... > Public Sub New(ByVal label As String, ByVal theDate As DateTime) ...
    (microsoft.public.dotnet.languages.vb)
  • SendObject Action Message
    ... Dim strMsg As String, strTitle As String ... 'There is no need to check if the form is blank (as with report and preview) ... 'will display the name of the report. ...
    (microsoft.public.access.formscoding)
  • Re: Output data from multiple records in a table
    ... Dim rsR As DAO.Recordset ... Dim strSQL As String ... >the other record into wordpad for display on the screen. ...
    (microsoft.public.access.modulesdaovba)