formatting

printf, sprintf print at least two decimal places

I'm trying to figure out how to use sprintf to print at least two decimal places and no leading zeros. For instance input: 23 23.0 23.5 23.55 23.555 23.0000 output: 23.00 23.00 23.50 23.55 23.555 23.00 any formatting help would be appreciated ...

is there a free open source text area type component for java which supports any number of regular expressions which will be highlighted in the text

I am looking for an existing free component that can support any number of regular expressions that will be highlighted in the text in any colour. The regular expressions should be configurable to work on a line by line basis, or spanning multiple lines. If such a component does not exist, i am considering creating it. In the past whe...

Formatting issue with IE6 working well with IE 6+

Hi All, I have my site working perfectly in IE 6+ but it looks weird in IE 6 or IE 5.5, as I can't ignore the users with IE6 because still around 6% of traffic occur from this version. I am looking forward to have the alternate. With my some research I came to know that by setting haslayout property, I can solve out formatting issue, b...

Display Date based on culture but Time based on a pattern

Does anybody know how to display the date of a datetime based on a CurrentCulture but the Time follow this pattern "HH:mm:ss.fff" ? I've tried to use: DateTime NewDate = DateTime.Now; NewDate.ToString(CultureInfo.CurrentCulture); It results: 4-6-2010 14:49:41. Expected: 4-6-2010 14.49.41,495. For the Time, I also need to show the mi...

Is it possible to disable Resharper reformatting of a section of a file?

Possible Duplicate: Is there a way to keep ReSharper from formatting a region of code When I want to test parsing logic on data that would usually be read in from a file or an HTTP call, etc, I usually turn that data into a string in the test. A (short) example is as follows: Line 1 Line 2 Line3 Line 4 Would become: ...

Problem with Sharepoint Tasks edited in Outlook that include table

After save the Table in Task body gets auto-converted to text. This is for Outlook 2010 which is connecting to Tasks in Sharepoint 2010 ...

Disable reformatting code when saving files

I made a small change to an old java file in IntelliJ and when I save the file the IDE automatically reformats all the code. Normally this would be preferable, however it seems almost every line has unnecessary white space that gets cleaned up. Now it appears the entire file was modified even though I only made a small fix. This will mak...

Fix formatting of aspx file in Visual Studio?

I have a file with a lot of this kind of thing in it: <asp:TableCell ID="TableCell9" runat="server">Company Organization:</asp:TableCell><asp:TableCell ID="TableCell10" runat="server"> How can I get the formatter to change it to shows like this: <asp:TableCell ID="TableCell9" runat="server">Company Organization:</asp:TableCell> ...

Algorithm for neatly printing a paragraph on a printer

First of all, this is not homework, so please don't tag it as homewrok I did not understand this problem. Can anybody explain it to me? It is not the english that I do not understand, but rather the general gist of the problem. ...

Display date _and_ time in user locale

I know I can use android.text.format.DateFormat.getDateFormat() to format my dates, and android.text.format.DateFormat.getTimeFormat to format my times, but how do I format a datetime? Similar to the getDateTimeInstance method from java.text.DateFormat. I'm currently just concatenating the result of both the getDateFormat and getTimeFor...

Qt - QPushButton text formatting

I have a QPushButton and on that I have a text and and icon. I want to make the text on the button to be bold and red. Looked at other forums, googled and lost my hope. Seems there is no way to do that if the button has an icon (of course if you don't creat a new icon wich is text+former icon). Is that the only way? Anyone has a better i...

Custom number formatting

I need to format a string in a custom number with the mask: "0000000-00.0000.0.00.0000". I try this code: string test = string.Format("{0:0000000-00.0000.0.00.0000}", 00014414720108190006); The output is: "144147201081900-06,00000000000" What is the best way to obtain a "0001441-47.2010.8.19.0006" in this example? Thanks in advance...

Why are months off by one with Java SimpleDateFormat ?

Hello, I am using SimpleDateFormat to display a Calendar like this : public String getDate() { String DATE_FORMAT = "EEEE, dd/MM/yyyy HH:mm:ss"; SimpleDateFormat sdf = new SimpleDateFormat(DATE_FORMAT); System.err.println(date.getTime().getMonth()); return sdf.format(date.getTime()); } The shell returns 6 and the dis...

Netbeans render unrecognized files as html

Hey Everyone, I am using Netbeans and very happy with it. Unfortunately I am having a little problem with it that I cant seem to figure out. I am using Silverstripe CMS and it uses a templating system that syntactically is basically just a mix of php and html. These files however end in .ss and therefore netbeans doesnt format and highl...

How to convert NUnit output into an HTML report

Does anyone have any suggestions for a good tool, xslt or other that can produce an HTML report from the XML output of NUnit? We're currently using NUnit 2.5.5 to run a number of tests on our code base. The dev team are happy seeing the output in the GUI and console runners and the report shown on our Hudson server. The Hudson generate...

Send <p> tags and simple HTML formatting through a form via PHP.

Hi, so I need the user to write a review about an article or book and send it to a DB via PHP but with some basic HTML formatting.. I mean, I have a form , when the user writes the review, the data is sent but without any kind of formatting, If the user want to write in a new line, the text is sent like plain text, I need to get also tho...

making jQuery plug-in autoNumeric format fields by time page loads...

Hi, I've been messing around with autoNumeric, a plug-in for jQuery that formats currency fields. I'd like to wire the plug-in so that all currency fields are formatted by the time the user sees the page, e.g., on load. Currently, the default that I can't seem to get around is that fields are formatted upon blur, key-up or other acti...

How to keep format within HTML converted to Excel

Hello, I'm working with an HTML table, that contains numbers (formated) and when I export this to xls file (just change extension... hehe) I loss some of the formated data. Example: in html I have " 1,000.00 | 500.00 | 20.00 " and in excel it shows like: "1,000.00 | 500 | 20" I want it to know if it is possible to show the very same...

java.text.DecimalFormat blank when zero?

Is it possible to show blank (empty string) when the number is zero (0)? (strict no zeros at left) ...

Right way to send HTML-Mails containing pictures: Use Server or Embedded images?

I want to .... create a html-email containing several images (company header, etc). The images shall be displayed as email content, not as an attachement. So how is the best way to do this? I'm aware of two possibilities: embedded images send as attachment (<IMG src="cid:321353119@02062010-119E">) images are placed on the server (...