format

Formatted Cell in Excel

自古美人都是妖i 提交于 2019-12-13 04:42:46
问题 I would like to ask how to format the cell in MS Excel. I have a text " AB12122 " and I would like to format into " AB12-122 " without using any formula. Is this possible? Thank you in advance. 回答1: I just dug around Google, and it looks like the only way to do it is with a formula. The custom formatting is really only useful for numbers. I can however make it say AB12122AB12122AB12122AB12122-AB12122AB12122, if that's helpful. :) Why can't you use a formula? 回答2: You may use character masking

how to format output of expanded variable

…衆ロ難τιáo~ 提交于 2019-12-13 04:38:52
问题 I am trying to make a variable equal the output of query but so i can pipe to another command but its not working as i hoped. here is what i have. $office=get-aduser "samaccountname" -properties * | select office I already tried using sub-expressions $folder= get-aduser "samaccountname" -properties * | select '$(office)' and @{n='office';e={$_.office -replace '^office='$1'}} neither of which remove the @{office=} My goal is to get $office=office but instead i get $office=@{office=} How do you

Converting form layout to table (csv) layout in perl

心不动则不痛 提交于 2019-12-13 04:28:36
问题 I have an input file inputfile.txt name: George age: 5 nature: curious likes: banana This is what I call a form layout. I am trying to convert this in to a table layout, CSV. For instance: name,age,nature,likes George,5,curious,banana So, I read the file, split on ": and \n" and place values in to a hash. Then push that hash in to an array so I can take them out later. Here is what I have done so far. #!/usr/bin/perl use strict; open (MYFILE, 'inputfile.txt'); my @records; while (<MYFILE>) {

How to display two digits after decimal every time using C#? [duplicate]

我是研究僧i 提交于 2019-12-13 04:25:18
问题 This question already has answers here : Leave only two decimal places after the dot (13 answers) Closed 5 years ago . I have a process, in which client want me to always display amount with two decimals either have value with decimal or not example: if 17 then i want to display "17.00" and if 17.2 then i want to display "17.20" or if 17.2033 then i want to display "17.20" i have tried String.Format("{0:.##}", rec.Rate) it does not works, please help me how can i do it.. thanks in advance 回答1

How to format a double value as time

送分小仙女□ 提交于 2019-12-13 04:13:22
问题 I am working on a program that reads gps data. A NMEA string returns time like this: 34658.00. My parser treats that as a double InputLine = "\\$GPGGA,34658.00,5106.9792434234,N,11402.3003,W,2,09,1.0,1048.47,M,-16.27,M,08,AAAA*60"; //NMEA string //inputLine=input.readLine(); if(inputLine.contains("$GPGGA")) { String gpsgga = inputLine.replace("\\", ""); String[] gga = gpsgga.split(","); String utc_time = gga[1]; if (!gga[1].isEmpty()) { Double satTime = Double.parseDouble(utc_time); gpsData

Poco::Logger print int8_t value

徘徊边缘 提交于 2019-12-13 03:55:09
问题 I am trying to print int8_t value with Poco::Logger in this way: using myint8_t = signed char; myint8_t var; var = 10; logger().information("%c", var); logger().information("%d", var); logger().information("%i", var); But as output have error which tells me that argument does not match the format specifier: 2018-10-02 00:12:40.627 [Information] [ERRFMT] 2018-10-02 00:12:40.627 [Information] [ERRFMT] 2018-10-02 00:12:40.627 [Information] [ERRFMT] Where is my mistake and how to print signed

Set result format of Facebook Graph API to XML instead of JSON

大兔子大兔子 提交于 2019-12-13 03:46:01
问题 I'm trying to change the format of the result i get from the facebook graph api to XML. I use the format=xml parameter but that don't seem to work for me. https://graph.facebook.com/me&access_token=xxxxxxxxxxxx&format=xml The result is shown in Json format :( Is it still posible to use the xml format? 回答1: The new graph api always returns data in json. XML has an overhead on communication size and processing required for parsing so it's being dropped from web API's. 回答2: That's part of the

Change date format that MySQL reads

非 Y 不嫁゛ 提交于 2019-12-13 03:14:24
问题 I have a batch file that was created for an Oracle database that I'm now trying to import to a MySQL database. I've had to deal with all sorts of inconsistencies between the two. The file has all the dates as '17-NOV-1981' rather than '1981-11-17' as MySQL expects. The batch file had the command ALTER SESSION set nls_date_format='DD-MON-YYYY'; to set the date format. Is there an equivalent in MySQL to get it to accept the dates as is without having to majorly edit the file? 回答1: I don't

How to add decimal separator to a grouped (money like) number?

旧城冷巷雨未停 提交于 2019-12-13 03:10:26
问题 Summary Are {0:#,##} and {0:#,#} different? I know that the . determines the location of the decimal separator in the result string, and the , serves as both a group separator and a number scaling specifier. As a group separator, it inserts a localized group separator character between each group. As a number scaling specifier, it divides a number by 1000 for each comma specified. Example Take a look at some examples: original #,## #,# 12568 -> 12,568 12,568 12568.12 -> 12,568 12,568 1.12 ->

Android String variable (HH:mm) to long variable miliseconds

时光毁灭记忆、已成空白 提交于 2019-12-13 02:30:40
问题 I have a String variable in this format "HH:mm" . Lets say the variable value is 05:30. How would I be able to get those numbers from string and calculate : (05 * 60 * 60 * 1000) + (30 * 60 * 1000) and put that number (miliseconds) in a new long variable. Basically I need to convert the String time variable into miliseconds long variable. 回答1: Let s contain the string of interest. Then e.g. you can say String s = "5:30"; Pattern p = Pattern.compile("(\\d+):(\\d+)"); Matcher m = p.matcher(s);