formatting

stop Ms Excel auto-formatting numeric strings as numbers

↘锁芯ラ 提交于 2019-12-22 11:26:49
问题 I am exporting a report from MS Access(2003) to Excel (97-2003) output. One of the columns has a character string that is numeric for some rows e.g. "05-0880". When I open the output file in MS Excel the corresponding cell is set to the number -372424 . I assume this is caused by Excel being "clever" and deciding that "05-0808" represents a time value or date of some sort and converting the string to a corresponding numeric value. In my case the data represents product codes and this

How to format a DateTime like “Oct. 10, 2008 10:43am CST” in C#

不羁的心 提交于 2019-12-22 09:07:01
问题 Is there a clean way to format a DateTime value as "Oct. 10, 2008 10:43am CST". I need it with the proper abbreviations and the "am" (or "pm") in lower case etc etc. I've done it myself but it's ugly so I'm looking for a different take on it. Thanks. 回答1: Since the "tt" format string specifier only outputs upper case, you'll have to modify that yourself. Also, DateTimes do not store the name of the timezone, only an offset. DateTime dt = DateTime.Now; string ampm = dt.ToString("tt").ToLower()

I'm having trouble positioning this button nicely

て烟熏妆下的殇ゞ 提交于 2019-12-22 08:52:29
问题 I've been goin at it now for an 1.5hrs and I just can't figure out a way to make it the way I want. I'm kind of new with all things web, and it takes about as much time (maybe more?) trying to get things where I want and doing it in a way that is elegant. Anyways, I have two text boxes, with two labels above them and centered over the box. I want to simply put a button in between them and about centered with the textboxes' height. This is as close as I can make it get to what I want. I would

Can I check if a format specifier is valid for a given data type?

北城以北 提交于 2019-12-22 08:37:34
问题 If I have (in .NET/C#) for instance a variable of type long I can convert it to a formatted string like: long value = 12345; string formattedValue = value.ToString("D10"); // returns "0000012345" If I specify a format which isn't valid for that type I get an exception: long value = 12345; string formattedValue = value.ToString("Q10"); // throws a System.FormatException Question: Is there a way to check if a format specifier is valid (aside from trying to format and catching the exception)

How to generate a human-readable string that represents a rrule object?

自闭症网瘾萝莉.ら 提交于 2019-12-22 08:15:10
问题 My app allows users define scheduling on objects, and they is stored as rrule. I need to list those objects and show something like "Daily, 4:30 pm". There is something available that "pretty formats" an rrule instance? 回答1: You simply have to provide a __str__ method and it will be called whenever something needs to render your object as a string. For example, consider the following class: class rrule: def __init__ (self): self.data = "" def schedule (self, str): self.data = str def __str__

Recommended HTML formatter script/utility? [closed]

房东的猫 提交于 2019-12-22 07:55:12
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 6 years ago . Simple question - I've got a bucketload of cruddy html pages to clean up and I'm looking for a open source or freeware script/utility

Delphi Function to Display Number of Bytes as Windows Does

ε祈祈猫儿з 提交于 2019-12-22 06:11:17
问题 This is a simple one (I think). Is there a system built in function, or a function that someone has created that can be called from Delphi, that will display a number of bytes (e.g. a filesize), the way Windows displays in a file's Properties box? e.g. This is how Windows property box displays various sizes: 539 bytes (539 bytes) 35.1 KB (35,974 bytes) 317 MB (332,531,365 bytes) 2.07 GB (2,224,617,077 bytes) The display is smart about using bytes, KB, MB or GB, and shows only 3 significant

Delphi Function to Display Number of Bytes as Windows Does

给你一囗甜甜゛ 提交于 2019-12-22 06:11:01
问题 This is a simple one (I think). Is there a system built in function, or a function that someone has created that can be called from Delphi, that will display a number of bytes (e.g. a filesize), the way Windows displays in a file's Properties box? e.g. This is how Windows property box displays various sizes: 539 bytes (539 bytes) 35.1 KB (35,974 bytes) 317 MB (332,531,365 bytes) 2.07 GB (2,224,617,077 bytes) The display is smart about using bytes, KB, MB or GB, and shows only 3 significant

How to Format a DBGrid Column to Display Two Decimal Places? [duplicate]

蹲街弑〆低调 提交于 2019-12-22 05:02:00
问题 This question already has answers here : Setting a DBGrid column format in Delphi (3 answers) Closed 4 years ago . I would like to format specific cells to force two decimal places. The data is coming from an ElevateDB stored procedure and hooked into a TDataSource. EDIT: SQL Programming Note: I wasn't sure if this was just an ElevateDB issue or not. Before knowing about the Fields Editor , I attempted to format the data at the SQL level by using a CAST (NumericField as varchar(10)) statement

Oracle Date Formatting Null date as 00/00/0000

我的未来我决定 提交于 2019-12-22 04:45:23
问题 How can I format the Null Dates in my Oracle SQL to 00/00/0000. I am using NVL function but it doesn't recognize the 00/00/0000 as the date format. Is there any Date Formatting available in Oracle SQL which formats null date to 00/00/0000 回答1: Do the to_char first and wrap it in the NVL. For example, select nvl(to_char(null, 'DD-MM-YYYY'), '00-00-0000') from dual 回答2: Use this function to assign default values of null values of date: SELECT id, NVL(start_date, to_date('20020101','YYYYMMDD'))