formatting

Freemarker format BigDecimal to German Locale not working properly

拈花ヽ惹草 提交于 2019-12-13 03:55:04
问题 Following the documentation of FreeMarker : Using : <#setting number_format="0.##"> <#setting locale="hu"> German people write: ${12345678} Should output as shown in picture but instead what i get is the below : For input new BigDecimal(4436372342.10) => 4 436 372 342,10 which doesn't have . but instead has spaces . Why that happens ? 回答1: Seems like there is a documentation error. locale="hu" sets a Hungarian locale. Its thousands separator is ' ' . To set a German locale, try locale="de_DE"

Excel VBA Convert Number stored as Text to Number in column

夙愿已清 提交于 2019-12-13 03:27:58
问题 I have a column of mixed data in my Excel sheet where the numbers are formatted as "Text". Some examples of the values that are stored in my column: 36 R4 56 AF PL RFD 65 DHU 14 I now need a macro that converts all the numeric values in the column to the format "Number" so that I can further process the data. I tried the following, which throws an error 400 without any further explanation: Sheet1.Range("A2","A50000").Select With Selection .NumberFormat = "General" .Value = .Value End With

How to take the lists created by xbrlDoAll in the XBRL package in R, and organize them into dataframes readable in Excel?

只谈情不闲聊 提交于 2019-12-13 02:17:07
问题 I've been experimenting with the XBRL package in R to try to write a function that would cycle through companies and output financial statements, ideally in a very standard dataframe. But, I don't understand the output. Using the function and then viewing the data frame, all that appears is a running total on the leftmost column, with right-justified URL's of various XML/XBRL/C++ components on the right. I admit I have very little XBRL knowledge, but I must be missing something. How would I

Format datatable values in VBA

﹥>﹥吖頭↗ 提交于 2019-12-13 02:16:12
问题 Currently working on a vba script that makes charts automatically. I would like to add a datatable which is done using: .HasDataTable = True However I would like to show the values of series as percentages. Currently the value is defined as a Double containing all the values but not the right formatting. Using Format() or FormatPercent() will give the right values but returned in a String. This works for the datatable but not for the chart itself since it doesn't recognize the values anymore.

Create a 2 column matrix with 2 different format types

我们两清 提交于 2019-12-13 02:15:28
问题 very very new to Matlab and I'm having trouble reading a binary file into a matrix. The problem is I am trying to write the binary file into a two column matrix (which has 100000's of rows) where each column is a different format type. I want column 1 to be in 'int8' format and column 2 to be a 'float' This is my attempt so far: FileID= fopen ('MyBinaryFile.example'); [A,count] = fread(FileID,[nrows, 2],['int8','float']) This is not working because I get the error message 'Error using fread'

Converting string into hex representation

谁都会走 提交于 2019-12-13 02:03:39
问题 I am looking for a good way to convert a string into a hex string. For example: '\x01\x25\x89' -> '0x012589' '\x25\x01\x00\x89' -> '0x25010089' Here is what I have come up with: def to_hex(input_str): new_str = '0x' for char in input_str: new_str += '{:02X}'.format(ord(char)) return new_str It seems like there is probably a better way to do this that I haven't been able to find yet. 回答1: You want the binascii module. >>> binascii.hexlify('\x01\x25\x89') '012589' >>> binascii.hexlify('\x25\x01

pandas dataframe string formatting (access a given column)

依然范特西╮ 提交于 2019-12-13 01:53:16
问题 I try to use new-style formatting to display the entry at a given/specified column: np.random.seed(1234) df = pd.DataFrame(np.random.randint(7, size=(2, 2)), columns=['a', 'b']) c = df.iloc[0, :] # get row number 0 print("Here is {one[0]} and {two}".format(one=c, two=c['b'])) # Ok But I'd like to do it as follows: print("Here is {one['a']} and {two}".format(one=c, two=c['b'])) ## Unfortunately KeyError: "'a'" Is it possible to do that and how? 回答1: I think you can remove '' in one['a'] :

Input code in TinyMCE

这一生的挚爱 提交于 2019-12-13 00:12:42
问题 I'm using TinyMCE on my blog and it seems to be removing the code I'm trying to paste. I want to add this: <Files somefile.png> DefaultType application/x-httpd-php </Files> (it's a .htaccess directive) This gets saved ok (as < and > in the html), but when I reopen my form for editing, it gets transformed as : DefaultType application/x-httpd-php Edit : I'm using TinyMCE in a Symfony form, using sfFormExtraPlugin. Edit 2 : I tried verify_html: false .... now my code gets transformed as : <p>

gnuplot - making use of the yrange in pie charts?

别说谁变了你拦得住时间么 提交于 2019-12-12 22:40:39
问题 This only works for me if I do not set a yrange. Let's say I have a sample-time-overview.csv like ,avg,std,,,TProc,2267.5202096317,4573.0532262204 TParse,4.9922379603,138.6595434301,,,,, THash,86.4020623229,548.8593468508,,,,, TEnq,1.1181869688,2.0684998031,,,,, TInQ,1482.2243626062,4257.8024051927,,,,, TSend,2253.1871161473,4514.2823125251,,,,, TWait,1.7578696884,43.1050730747,,,,, TAnsw,14.3452407932,201.9216484892,,,,, TProcAll,2269.2780793201,4573.3927526674,,,,, TTotal,3853.3679320114

Easy way to check FormatString is valid?

谁说胖子不能爱 提交于 2019-12-12 21:14:35
问题 Is there an easy way to check if a format string is valid? For example the following is code that we use to test a number format string; public static bool IsValidFormatStringNumber(string FormatString) { try { const decimal number = 0.056m; var formattedNumber = number.ToString(FormatString); return formattedNumber.Length > 0; } catch { return false; } } We're trying to catch an exception or determine if the resulting string has no length. This test fails however as a format string of