format

excel vba select second to last character in a cell

柔情痞子 提交于 2019-12-11 09:13:21
问题 I thought this would be simple but can't find the solution anywhere! I am writing a macro to insert a red tick (or down arrow) after the existing text in a cell. ActiveCell.FormulaR1C1 = ActiveCell & " P " The P needs to be formatted bold, red and Wingdings 2. It needs a space after it in case text is added at the end in the future. No problem if it is before the text: With ActiveCell.Characters(Start:=2, length:=1).Font How to select it when it is the second to last character in the cell

Reading one & Update some other Excel with c#

别来无恙 提交于 2019-12-11 09:03:36
问题 I am developing a small winform utility to read one excel & update other excel. I am trying to read source excel file (which has several hidden columns & rows) using OLEDB. I am able to do it and get output in Datatable but facing few challenges below: Sheet has columns with numbers, dates and string. After reading through OLEDB, all numbers get converted to dates or vice versa. I don't want this to happen. I have read several solutions like setting IMEX to 1 in connection string but nothing

How do I print a list of doubles nicely in python?

纵然是瞬间 提交于 2019-12-11 08:52:29
问题 So far, I've got: x=[0.0, 1.2135854798749774, 1.0069824713281044, 0.5141246736157659, -0.3396344921640888, -0.33926090064512615, 0.4877599543804152, 0.0] print ' '.join(["%.2f" % s for s in x]) which produces: 0.00 1.21 1.01 0.51 -0.34 -0.34 0.49 0.00 the problem being that -0.34 is one character longer than 0.51, which produces ragged left edges when printing several lists. Any better ideas? I'd like: 0.00 1.21 1.01 0.51 -0.34 -0.34 0.49 0.00 0.00 1.21 1.01 0.51 0.34 0.34 0.49 0.00 0.00 1.21

Decimal money format

依然范特西╮ 提交于 2019-12-11 08:49:14
问题 how to convert all numbers to xx,xx decimal format without exploding number or string? like; 8,9 --> 8,90 8,99 --> 8,99 12,1 --> 12,10 129,9 --> 129,90 any idea? 回答1: You can use number_format like: $n = 2.1; echo number_format($n, 2, ','); // 2,10 If you have commas as decimal separators in your input you can convert values to float with: $number = floatval(str_replace(',', '.', str_replace('.', '', $string_number))); str_replace('.', '', $string_number) is used to remove thousand separators

CurrentCulture.DateTimeFormat.LongTimePattern Read-Only

扶醉桌前 提交于 2019-12-11 08:25:05
问题 I'm trying to set LongTimePattern property of CurrentCulture with the following code: System.Threading.Thread.CurrentThread.CurrentCulture.DateTimeFormat.LongTimePattern = "HH:mm:ss"; and I'm getting InvalidOperationException: Instance is read-only. Any idea how can I change it? I want to force LongTimePattern to show 24h format for any culture. 回答1: If you change the System.Threading.Thread.CurrentThread.CurrentCulture then it will automatically update the LongTimePattern. You can't make any

C# error : Input string was not in a correct format

你说的曾经没有我的故事 提交于 2019-12-11 08:13:08
问题 I was getting this error: "Input string was not in a correct format." Here is my Code: private void UpdatePOdetailBalance(int Qty) { int newbal; SqlCommand com = new SqlCommand(); com.Connection = cn; newbal = Convert.ToInt16(txtQtyOrdered.Text) - Qty; com.CommandText = "UPDATE PODetail SET BalanceQty="+ newbal +" WHERE OrderID=" + Convert.ToInt16(txtPONumber.Text) + "AND ItemID=" + Convert.ToInt16(txtItemNo.Text); com.ExecuteNonQuery(); } private void btnOK_Click(object sender, EventArgs e)

Rails Simple_Form: How to show long name of the country

冷暖自知 提交于 2019-12-11 08:11:43
问题 I use simple_form gem to select country: = simple_form_for @shop, :url => { :action => "create" }, :html => {:id => 'new_shop' } do |f| = f.simple_fields_for :address, :html => {:multipart => true} do |o| = o.input :country, :label => "Country" But the name of the country is being saved in short format in the database (like RU , FR , AU , and so on). I wonder, how can I show the full, long name of the country in the views? Thanks! 回答1: Actually is a good idea saving the country code in the

what is the jqgrid footer json format

只谈情不闲聊 提交于 2019-12-11 07:53:56
问题 i am currently trying to solve my problem with the total in the footer. i tried searching in the internet with some examples, but they are using php, and i am using java. can you please show me what exactly the json looks like for this php script $response->userdata['total'] = 1234; $response->userdata['name'] = 'Totals:'; is this what it looks like? {"total":0,**"userdata":[{"total":1234,"name":"Totals"}]**,"page":0,"aData":..... thanks. 回答1: userdata must look like "userdata":{"total":1234,

Format numbers in JavaScript similar to C#

半城伤御伤魂 提交于 2019-12-11 07:42:23
问题 Is there a simple way to format numbers in JavaScript, similar to the formatting methods available in C# (or VB.NET) via ToString("format_provider") or String.Format() ? 回答1: You should probably have a look at the JQuery NUMBERFORMATTER plugin: Jquery Number Formatter And this question: Javascript easier way to format numbers 回答2: Generally Formatting numbers in JavaScript Formatting numbers for currency display and more. In jQuery autoNumeric (a decent number formatter & input helper with

How to convert unicode to 4 bit binary representation?

こ雲淡風輕ζ 提交于 2019-12-11 07:38:37
问题 I have the following functions: def dict_to_binary(the_dict): json_dict = json.dumps(the_dict) binary = ' '.join(format(ord(letter), 'b') for letter in json_dict) return binary def binary_to_dict(the_binary): jsn = ''.join(chr(int(x, 2)) for x in the_binary.split()) d = json.loads(jsn) return d These functions take in a dict object, cast it to json, and then use ord to get the unicode for each item in the json and then convert that to binary. How can I edit that format string to do this for 4