|
-
Dec 18th, 2003, 07:26 AM
#1
Thread Starter
Member
Formatting Text Box
hello, well i want to format a text box called txtdis.text
the contents of this will be prices so for e.g 3.25 and so on
but it ends up going further in and comes out with an output of 3.25675 and so on.
How can i cut this to make it a 2 decimal place figure like normal cash 
cheers
-
Dec 18th, 2003, 07:27 AM
#2
Fanatic Member
txtdis = format(myValue, "#0.00")
-
Dec 18th, 2003, 07:28 AM
#3
Thread Starter
Member
-
Dec 18th, 2003, 07:29 AM
#4
Fanatic Member
just a variable
could be 3.25675 or whatever
-
Dec 18th, 2003, 07:31 AM
#5
Thread Starter
Member
the items that will be in txtdis will be the values coming out of a list box, like items in the list box will be prices, when they go into the textbox its all multiple decimil placed. :/
so what would the variable be :/ sorryy im a newb1e only been programming for 3 months
-
Dec 18th, 2003, 09:12 AM
#6
Hyperactive Member
with no code to hand, it has to be along the lines of :
Textbox1.text = format(listview1.SelectedItems.Item(0).text, "##0.00")
thats just playing with objects and properties and in theory selects the first item i.e. item(0) and trys to display it as a decimal number, with two decimal places
Are you not alllowed to do research where you are, because if so you will struggle and this forum is better placed to pose really hard questions, which we all have suffered from
-
Dec 18th, 2003, 09:15 AM
#7
Thread Starter
Member
-
Dec 18th, 2003, 12:36 PM
#8
Hyperactive Member
msdn is a god place to start
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|