FAQ Database Discussion Community

## Excel formatting with Java Apache POI

java,excel,formatting,apache-poi
I have an excel file in the following format: I would like to restructure this format and have it outputted in the following format: The sections are repeating and can appear in any order but they will have either format. The 'Check' column is sometimes merged across rows as shown...

## SSRS Average Time in Minutes and then Format to HH MM

sql,stored-procedures,reporting-services,formatting
I've seen a lot of questions about average time in SSRS but I'm pretty new to this and none of these questions address my specific need so any help would be appreciated. I have a duration field (Fields!Duration1.Value) which is pulling in a duration in minutes (example: 170). In my...

## MySql datatype versus PHP formatting whilst not losing numeric sorting capabilities

php,mysql,types,formatting
See http://pdga-europe.com/standings-2015/ It's probably the simplest question you've seen in a while, but I'm stumped. I am importing an XLS sheet to MySql database, and most data is integers, but some (really, only some) are fractions (at an exact .5) Data type gets set to DECIMAL (4,1) by PHPMyAdmin, and...

## Retaining original table formatting after a 'pagebreak'

excel,excel-vba,table,formatting,page-break
So here's the finished product, a statement of accounts with a working statement table, and an ageing analysis: Everything works great. It basically populates itself row by row with data from another table. Here is the sample code: j = 21 'First row on the statement of accounts workbook For...

## How do I convert a double into an n-character string using exponential notation?

java,string,formatting,double
I have found this vise-versa many times on SO, but never like I want it. I want to convert a double into a string that takes up exactly n characters. If n is, for example, 6, then 1,000,123.456 would become 1.00E6 -1,000,123.456 would become 1.0E-6 1.2345678 would become 1.2345 1,000,000,000,000...

## How do I pass an HTML document to CodeMirror as a start value?

javascript,html,xml,formatting,codemirror

## How to apply scales::percent or scales::percent_format() to prop.table in R to format numbers as percentages

r,formatting,plyr,percentage,crosstab
Consider the following example: tab <- table(mtcars$vs, mtcars$cyl, dnn = c("vs", "cylinder")) prop.table(tab) # cylinder # vs 4 6 8 # 0 0.03125 0.09375 0.43750 # 1 0.31250 0.12500 0.00000 round(prop.table(tab)*100, 1) # cylinder # vs 4 6 8 # 0 3.1 9.4 43.8 # 1 31.2 12.5 0.0 Desired...

## Reformatting Dictionary output in python

python,csv,formatting,ordereddictionary
I have an OrderedDict and I've exported it to a csv but I want it to be formatted differently. My code for reading, sorting, and making the dictionary: from collections import defaultdict, OrderedDict counts = defaultdict(lambda: {"User": 0, "Equipment": 0, "Neither": 0}) with open('sorterexample.csv', 'rb') as fh: reader = csv.reader(fh,...

## Populate DataGridView Column With a Double forcing to 2 Decimal Places, with Sort

vb.net,sorting,datagridview,formatting
Sorry for the weird title but I didn't know how to phrase it any better. I'm trying to populate a column on my DataGridView with a number that has 2 decimal places. To do this I'm using Dim _Size as Double = 1.2345 DataGridView1.Item(0, 0).Value = Format(_Size, "0.00") This populates...

## How to set font-weight of a column text to bold based on another column value in Telerik Grid

telerik,formatting,conditional,client-templates
I have a Telerik grid in which based on whether my IsTrue value is true or false, I need to set the font-weight of Name text in only that particular row to bold. I tried the following but I seem to be missing something. columns.Bound(d => d.IsTrue).Width(0).HtmlAttributes(new { id="hdnIsTrue", style...

## Is there analog of fmt:formatNumber in velocity like in jsp?

jsp,formatting,velocity,template-engine

## MariaDB formatting view code

When i save view on mariadb on debian(6) I lose comments and formatting of code. What is this feature of mariadb? How turn if off? On windows instance all comments and formats are stored. Both instances is MariaDB 10.0.17. Managed with Heidi 9.1 from Windows. Edit 1. Semi solved. LOAD_FILE...

## Specifying styles for portions of a PyYAML dump (II): sequences

python,formatting,yaml
This is a follow up question to Specifying styles for portions of a PyYAML dump: Consider following code contaning as input manually formatted YAML data. I am modifying the YAML data, but would like to keep edges on single lines in the written YAML file. import yaml st2 = yaml.load("""...

## Is there a specific way to input characters at the beginning of a new line?

python,string,formatting
Current I am trying to implement a way to input ">" at the beginning of each separate line in a string. An example would be: String: "Hello how are you! Python is cool!" Now that's all one big string, with a line break. But is there a function to establish...

## How can I print decimal places, up-to the point there are not two repeating zeros?

java,floating-point,formatting
I would like to change the below output 5250.000000000000 5512.500000000000 5788.125000000001 6077.531250000001 6381.407812500002 6700.478203125002 7035.502113281253 7387.277218945315 7756.641079892581 8144.47313388721 To the below output. 5250.0 5512.5 5788.125 6077.53125 6381.4078125 6700.478203125 7035.50211328125 7387.277218945313 7756.641079892578 8144.473133887207 So it appears the logic I need, is to only print decimal places if there is less than...