473,396 Members | 2,113 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

cutting off digits and rounding up/down

1
I am looking for a function in visial basic.net that takes a string, containing a decimal, like 12.5958, and returns the string with x numbers of digits behind the comma with appropriate rounding.

like x = 3 --> 12.596
and x = 2 --> 12.60

I can write it myself, but I am hoping its out there already, savingme the time.

thanks
Jul 13 '10 #1
0 1029

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: spebola | last post by:
I am using vb.net 2003 professional and I get the following results when using the round method: dim Amount as decimal = 180.255 Amount = Amount.Round(Amount, 2) Amount now contains 180.25. ...
2
by: Rob Keel | last post by:
Hi, Totally new to programming and am using VB.net. Question ... I have a simple form with three text boxes ... TextBox1, TextBox2 and TextBox3. In TextBox3 I would like to return the value of...
1
by: David | last post by:
Hi, I have a report which may have calculated results fields as: 1498.13 or 964.5 I would like to know how to round up or down to 1498 or 964, or round up if over .5
5
by: Cygnus | last post by:
Sorry in advance for the lack of formatting in this posting. Data: (column headers) Net Sales | Royalty Rate | Total Royalty (data) 4.31 | 50.00% | 2.15 19.35 | 50.00% | 9.68
5
by: asurratt | last post by:
Hi, I have (2) CMD statements that are used to log when a table starts loading in the database with our automated BCP process and another that will log when it completes and determine the duration...
13
by: Shirsoft | last post by:
I have a 32 bit intel and 64 bit AMD machine. There is a rounding error in the 8th digit. Unfortunately because of the algorithm we use, the errors percolate into higher digits. C++ code is...
18
by: jdrott1 | last post by:
i'm trying to round my currency string to end in 9. it's for a pricing application. this is the function i'm using to get the item in currency: FormatCurrency(BoxCost, , , , TriState.True) if...
5
by: narpet | last post by:
Okay... here's my query: select tblPreGenTLL.RiskNumber, tblPreGenTLL., cast((tblITMmaster.ITM * (tblManuals. * .)) + ((tblITMmaster.ITM * (tblManuals. * .)) * .1526) + (.DWRFRate) + (.) +...
1
by: sjohnson1984 | last post by:
Hi all, here's a quick for which I haven't been able to track down a quick solution on Google. The 2 amounts delivered ('outgoings' and 'alreadyprotected' will always be between 0 and 9999. ...
8
by: Lewe22 | last post by:
I have 2 fields in a table called and . They are both in short time format. I am displaying these in a form with a calculated field to show the time duration as well. (ie. = -) this is also...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.