formatting

Format column with date to specific format - Excel VBA

柔情痞子 提交于 2019-12-11 18:21:32
问题 I am writing an excel vba macro. I have a large worksheet with over 10,000 rows. One of the columns has the date in this format: 10/28/13 06:57 with the Cells having a General Number for formatting. I would like to format it to have only four digits in this format: mmdd (1028 for the example above) Here is what I have so far in the subroutine: ' This subroutine formats the columns to what is necessary for output Sub formatColumns() ' Set the LastRow variable to hold the last row number

Grouping checkboxes for individual boolean values using css, twitter-bootstrap, and simple_form

落爺英雄遲暮 提交于 2019-12-11 17:51:17
问题 Can you please help me format this simple_form? I am using this form: <%= simple_form_for @my_model, :html => { :class => 'form-horizontal'} do |f| %> <%= f.error_notification %> <div class="form-inputs"> <%= f.input :some_text, :input_html => {:class => "span6", :rows => 2}%> <%= f.input :a_description, :input_html => {:class => "span6", :rows => 2}%> <%= f.input :boolean1%> <%= f.input :boolean2%> <%= f.input :boolean3%> <%= f.input :boolean4%> <%= f.input :boolean5%> <%= f.input :boolean6%

keeping PDB file format after editing.

99封情书 提交于 2019-12-11 17:00:48
问题 I have xxx.pdb files as: ATOM 1910 CB SER 128 45.806 50.621 39.840 1.00 9.36 ATOM 1913 OG SER 128 44.538 51.195 39.571 1.00 9.36 ATOM 1915 C SER 128 45.325 48.172 40.360 1.00 9.36 ATOM 1916 O SER 128 45.368 47.955 39.155 1.00 9.36 ATOM 1917 N SER 129 44.953 47.236 41.238 1.00 11.24 ATOM 1919 CA SER 129 44.395 45.938 40.826 1.00 11.24 ATOM 1921 CB SER 129 44.091 45.053 42.031 1.00 11.24 ATOM 1924 OG SER 129 43.483 45.786 43.085 1.00 11.24 When I tried this code: awk '{if($10<11){$9="1.50"}

SQL reporting services report not showing date in correct format

安稳与你 提交于 2019-12-11 16:49:54
问题 i have built a reporting services report off SQL server 2005 and am having trouble getting the date to format correctly in a stand-alone textbox. The code i am using is as follows: ="Date: " & FormatDateTime(Parameters!date.Value, 2)) -- According to MSDN it should work off my systems culture when set to '2' however it is not. Currently being displayed = MMDDYYYY, Want to display = DDMMYYYY Does anyone know what i am doing wrong? 回答1: The reports have their own Internationalisation settings -

Formatting based on condition in bash

痴心易碎 提交于 2019-12-11 16:47:22
问题 Here is my code: grep -E -o "\b[a-zA-Z0-9.-]+@[a-zA-Z0-9.-]+\.[a-zA-Z0-9.-]+\b|first_name.{0,40}|[(]?[2-9]{1}[0-9]{2}[)-. ]?[2-9]{1}[0-9]{2}[-. ]?[0-9]{4}" file.txt | awk -v ORS= ' NR>1 && !/,/ {print "\n"} {print} END {if (NR) print "\n"}' | sed -e :a -e '$!N;s/\n[0-9]{3}/,/;ta' -e 'P;D' | sed '$!N;s/\n\s*[0-9]//;P;D' I'm pretty close. The above code works, but is removing the first digit from phone number. I'm looking for a bash solution to do the following: Combine two lines if the lines

DataGridView decimal value formatting: kosher way

元气小坏坏 提交于 2019-12-11 16:34:00
问题 I need to display decimal values in DataGridView if (dgvClients.SelectedRows.Count != 0) { DataGridViewRow row = dgvClients.SelectedRows[0]; row.Cells["NetAccountValue"].Value = info.DecimalValue; } I need to format value up to given digits after decimal separator. The problem is that cell Value property stores reference to decimal in my case. When displayed decimal.ToString() is called and default decimal.ToString() produces unformatted string with lots of digits. One way is to create string

FormatNumber replacing number with 0

半城伤御伤魂 提交于 2019-12-11 15:45:18
问题 Not understanding this: Number returned from DataReader: 185549633.66000035 We have a requirement to maintain the number of decimal places per a User Choice. For example: maintain 7 places. We are using: FormatNumber(dr.Item("Field"), 7, TriState.false, , TriState.True) The result is: 185,549,633.6600000. We would like to maintain the 3 (or 35) at the end. When subtracting two numbers from the resulting query we are getting a delta but trying to show these two numbers out to 6,7,8 digits is

Programmatically setting content to fill screen between tab bar and nav controller

点点圈 提交于 2019-12-11 15:23:58
问题 I have a UIwebview that I want to fill the screen between the navigation bar at the top and the tab bar at the bottom. My web view is being defined programmatically and I was initializing it with a frame as below. I have been able to get the desired behavior by hard coding in some values, but I have seen that this does not work across all devices. Specifically, it seems that different OS's might consider (0,0) as different points on the screen (the top left corner of the screen for some, and

Custom date validation in google sheets with popup alert

眉间皱痕 提交于 2019-12-11 15:10:14
问题 I have a google sheet which is edited everyday by over 20 people. And sometimes it happens that someone paste something other than a date in "Date Column" or just simple write date in incorrect format. So I am looking to make a script which set date format to "yyy-mm-dd", then set data validation to check if date is correct (to avoid situation when you have a date like "2017- 22 -17"), and at the end popup message box if you have pasted or wrote incorrect date. I wrote below code and

Why breaking line (\n) doesn't work in my code?

柔情痞子 提交于 2019-12-11 15:09:18
问题 I'm creating table of TV providers and contacts to them. The general functionality you can see there: https://imgur.com/u5uREJm Table is constructed in way, that in each row is button with provider. After clicking this button next row is opened under clicked one, showing contact information. ContactRow contains 2 cells. In the first one i put emails, in the second phone numbers. However it is not presented nicely, contacts looks like like the've been spit out instead of correctly formatted.