473,385 Members | 1,587 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,385 software developers and data experts.

String Formatting; Tailing Zero's

I have a number, for example 17.7 and I want to format to a string as
"17.70", with the tailing zero.

Using Math.Round( dValue, 2 ) - produces "17.7".

Any other functions which will do what I want, before I start writing
formatting code?

Thanks
Jul 15 '08 #1
1 1455
On Jul 15, 5:11*pm, Shaw <nws...@yahoo.comwrote:
I have a number, for example 17.7 and I want to format to a string as
"17.70", with the tailing zero.

Using Math.Round( dValue, 2 ) - produces "17.7".

Any other functions which will do what I want, before I start writing
formatting code?
dValue.ToString("f2")

Jon
Jul 15 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: Pascal | last post by:
Hello, I've a float number 123456789.01 and, I'de like to format it like this "123 456 789.01". Is this possible with % character?
4
by: Dave Brydon | last post by:
Access 2003 I have a combo box in my personnel table, which draws its data from a trade code table; the original field in the code table, is numeric, Long Integer, and formatted with 5 zero's . ...
7
by: Roger Helliwell | last post by:
Hello Everyone, Has anyone found a quick reference for the many string formatting options for string.Format() ? I'm spending a ridiculous amount of time trying to write one line of code that...
6
by: Larry Lard | last post by:
I am trying to apply the following easy-to-state formatting rule to display a number: - If the number is positive or negative, display it in the 'default' way - If the number is zero, the...
4
by: Lauren Wilson | last post by:
Hi folks, We have a need to replace sub strings in certain message text. We use the Office Assistant to display help and often use the imbedded formatting commands. Those of you who have used...
15
by: angellian | last post by:
Sorry to raise a stupid question but I tried many methods which did work. how can I conserve the initial zero when I try to convert STR(06) into string in SQL statment? It always gives me 6...
4
by: psbasha | last post by:
Hi, I have a string str1 = 'Pnt ', I would like to remove the spaces from the tailing end of a string. I/P : str1 = 'Pnt ' O/P : 'Pnt'
2
by: psbasha | last post by:
Hi I would like to edit the string in a give line of string. Sample >>> str1 = 'Pnt1 1000 1 2 3 ' >>> str2 = str1 >>> str3 = '2000 ' >>> str4 = str2 + str3 +...
3
by: Ulrich Eckhardt | last post by:
Hi! I'm still mostly learning Python and there is one thing that puzzles me about string formatting. Typical string formatting has these syntaxes: "%s is %s" % ("GNU", "not Unix") "%(1)s...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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...

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.