formatting

What's the best design pattern for formatting numbers?

I need to write the code that would format the value according to the specified options. Right now there is several formatting options that can be chosen: rounding/truncating the number with the specified precision, added prefix (e.g $) or postfix (e.g. %), grouping thousands (applying commas), adding numeric abbreviations (KMB). So e....

Cell Format Strings for Reporting Services/Dundas Charts

Reporting services use format strings to auto format cell data. For example "c2" formats a cell to be displayed as currency with a decimal precision of 2. Does anyone know where I'd find a comprehensive list off all the different formats available? ...

Get raw text from markdown'ed text

In my DB, I have a text that is markdown'ed. The same way than SO does when showing the excerpts of the questions, I would like to get the N first characters of the text, i.e. all formatting must be removed. Of course the MD -> HTML step must be avoided and the work must be done on the MD'ed text. Performance is a requirement. Thx. ...

Tools for Applying an Arbitrary Lint to PHP code?

Are there any existing tools for applying an arbitrary lint to PHP code? I know about the command line flag (-l) and pecl extension that will check an input file for valid syntax. What I want is a tool that will let me reject something if it has a certain valid but undesirable syntax. For example, the lint might reject this if ($foo) ...

Reporting services: grouping rows with color

Hello! I've got a table in SQL Server Reporting Services report. Several rows can have the same value in one of the columns and I'd like to mark such 'groups' of rows with alternating colors. How should I do that? ...

Pad a number with starting zero in .Net

Hi, I have a requirement to pad all single digits numbers with a starting zero. Can some one please suggest the best method? (ex 1 -> 01, 2 -> 02, etc) ...

What page-image generating technology should I use?

I'm building a desktop application right now that presents its human-readable output as XHTML displayed in a WebBrowser control. Eventually, this output is going to have to be converted from an XHTML file to a document image in an imaging system. Unlike XHTML documents, the document image has to be divided into physical pages; addition...

Respecting on-the-fly changes to Windows time format.

I am working on a C# app that tries to respect the time format of the system it is running on. If the Windows control panel is changed to 24 hour format, that is the format the app will display time in. Anyway, it does this successfully, except it will only work if the time format is changed before the app is run. If you change the Wi...

asp:repeater - headers at section change

Hi, is there any way to bring up a subheader row at changes in a field in an databound asp:repeater control e.g. Instead of country | colour | number uk | red | 3 uk | green | 3 france | red 3 Do this: ==UK== colour | number red | 3 green 3 ==FRANCE== colour | number red | 3 Many thanks for any help. ...

How to convert a float to a string regardless of regional settings?

My product is targeted to a Portuguese audience where the comma is the decimal symbol. I usually use CString::Format to input numbers into strings, and it takes into account the computer's regional settings. While in general this is a good approach, I'm having problems in formatting SQL queries, for instance: CString szInsert; szInsert....

How can I output a number as a string of bits in C#?

In C#, how can I output a number as binary to the console? For example, if I have a uint with the value of 20, how can I print to the console: 00010100 (which is 20 in binary)? ...

Is there a Vim equivalent to the Linux/Unix "fold" command?

I realize there's a way in Vim to hide/fold lines, but what I'm looking for is a way to select a block of text and have Vim wrap lines at or near column 80. Mostly I want to use this on comments in situations where I'm adding some text to an existing comment that pushes it over 80 characters. It would also be nice if it could insert ...

String formatting in Python

I want to do something like String.Format ("[{0}, {1}, {2}]", 1, 2, 3) which returns: [1, 2, 3] How do I do this in Python? ...

Get correct indentation in Resharper

Right now resharper formats our code like this: private readonly List<Folder> folders = new List<Folder> { new Folder() }; but I want it to look like this: private readonly List<Folder> folders = new List<Folder...

SQL Formatting Standards

In my last job we worked on a very database heavy application and I developed some formatting standards so that we would all write SQL with a common layout. We also developed coding standards but these are more platform specific so I'll not go into them here. I'm interested to know what other people use for SQL formatting standards. Unl...

I need to show excel data on a presentable web page or word doc?

I have survey results which are formatted in excel fine. I then need to show these results indivually wiht the headings on a presentable word doc or wewb page? s there any weay to do this. For example: column one - comlumn 2 result 1 - result 1 result 2 - result 2 to comlumn 1 result one column 2 result one column 1 res...

Good free offline PL/SQL formatter

Hello. Does anyone knows a good formatter for PL/SQL free and offline? Thank you very much. ...

HTML formatting Problem : MS Word Document Generation with OpenOffice 2.4

I am using Openoffice.org to convert HTML document into a Microsoft Word document. We used divs to create a formatting block, but Openoffice is ignoring it. So we are forced to use tables and those, too are spilling out of the generated Word document on the right side. So i was wondering if there was any other way, where I can have form...

Does this custom DateTime format break in other cultures?

When displaying my DateTime values, I want them to be formatted like so: "February 9, 2009 7:00 AM" I am using the following code, but am concerned that the date may display incorrectly in other cultures. Can anyone tell me if this is the case or not, and if it is how can I fix it? Date.ToString("MMMM dd, yyyy hh:mm tt"); Thanks! ...

Is there any escaping for skype emoticons?

I'm getting frustrated with skype "emo-formatting" my code/commands that I want to tell others about. Is there a way that I can get skype to not convert my text to emoticons? e.g. so the person at the other end can copy the code block straight into their editor as well as see it correctly formatted in the chat window? ...