format

Chart.js 2.0 Formatting Y Axis with Currency and Thousands Separator

笑着哭i 提交于 2019-12-04 18:11:01
问题 I am having problems with formatting my chart axis and I am not able to find an example for the updated version 2.0. How can I (for example) make 2000000 to €2.000.000? My fiddle: https://jsfiddle.net/Hiuxing/4sLxyfya/4/ window.onload = function() { var ctx = document.getElementById("canvas").getContext("2d"); window.myBar = new Chart(ctx, { type: 'bar', data: barChartData, options: { title: { display:true, text:"Figure" }, legend: { position: "bottom" }, tooltips: { mode: 'label',

Is there a way to format a String in Flex

ぐ巨炮叔叔 提交于 2019-12-04 17:57:51
问题 Is it possible to do something like this: var s:String = format("%20d %-10s %s", time, type, message); In languages like C, C++, C#, Python, and Perl there is something similar to my example, but I can't seem to find it for Flex. I don't want to create special class Formatter for every string that I want to format. 回答1: You probably are looking for mx.utils.StringUtil.substitute(). Works similar to .NET String.Format(). For Example: StringUtil.substitute("Hello {0}", ["World"]); Adobe

git pre-commit hook format code - Intellij/Android Studio

爷,独闯天下 提交于 2019-12-04 17:15:26
问题 This gist shows how to auto-format Java code using the Eclipse formatter at pre-commit. Source: https://gist.github.com/ktoso/708972 Code: #!/bin/sh # # This hook will run the eclipse code formatter before any commit # to make the source look as it's supposed to look like in the repo. ECLIPSE_HOME=$HOME/eclipse STYLE_FILE=$HOME/org.eclipse.jdt.core.prefs echo "Running pre-commit hook: run-eclipse-formatter---------------------" echo "Will run eclipse formatter, using: $STYLE_FILE" echo

How to remove leading zeroes from day and month values in Oracle, when parsing to string using to_char function?

跟風遠走 提交于 2019-12-04 17:11:33
问题 I want to retrieve a date without the leading zeroes in front of the day and month values in a select statement. If I execute the following query select to_char(sysdate, 'dd.mm.yyyy') from dual; I will get 21.03.2014 as a result. Moreover, if today was, for example, 7th of March, 2014, I would get 07.03.2014. How can I get rid of these leading zeroes? 回答1: select to_char(sysdate,'DD.MM.YY') -- Without Fill Mode , to_char(sysdate-20,'fmDD.fmMM.YY') -- With Fill Mode, 20 days ago from dual;

boost log format single attribute with logging::init_from_stream

狂风中的少年 提交于 2019-12-04 16:34:00
When I set up format params in code, to format date time output I can use something like this logging::formatter simpleFormat(expr::format("%1% %2%") % expr::format_date_time<boost::posix_time::ptime>("TimeStamp", "%H:%M:%S") % expr::smessage ); But when I initialize logger with a config file, I can specify format only in attributes position notation, not their format details. so, this line in a boost log config file Format="[%TimeStamp%]: %Message%" produces output: [2015-Feb-06 09:32:27.401496]: blah blah blah I want to reduce timestamp to something like this [06.02.2015 09:32:27] How can it

Is there a string formatting operator in R similar to Python's %?

独自空忆成欢 提交于 2019-12-04 15:44:24
问题 I have a url that I need to send a request to using date variables. The https address takes the date variables. I'd like to assign the dates to the address string using something like the formatting operator % in Python. Does R have a similar operator or do I need to rely on paste()? # Example variables year = "2008" mnth = "1" day = "31" This is what I would do in Python 2.7: url = "https:.../KBOS/%s/%s/%s/DailyHistory.html" % (year, mnth, day) Or using .format() in 3.+. The only I'd know to

How to format date and time values for SQLite?

我们两清 提交于 2019-12-04 15:23:58
Can't believe I have to ask this here. Even googling didn't help. I want to do this: insert into atable (adatefield,atimefield,adatetimefield) values (A,B,C); adatefield is defined as DATE atimefield is defined as TIME adatetimefield is defined as DATETIME What do I put for A, B and C? It's nice that it's free but the documentation for SQLite is awful. A date, time and datetime field will actually all store datetime, it just depends on what you insert into it, and they will all work with date strings. You can insert into atable values("2010-11-16","14:12:22","2010-11-16 14:12:22"); or you can

Formats for communicating between backend and Objective-C/Cocoa

不问归期 提交于 2019-12-04 13:48:31
问题 I'm developing an iPhone app that is connected to a backend server. It needs to communicate with it many times, through several requests. I'm sending HTTP messages, but I want to receive more complex responses that I can parse somehow. Supposedly, I can provide any type of format for responses from the server, so my question is: which one would be easier(maybe even faster) to use/parse for Objective-C/Cocoa, and transform in a dictionary of some kind? I know it's a bit subjective but I still

Masked input Plugin with date limit

三世轮回 提交于 2019-12-04 13:23:51
I use masked input on a input text field for a date in the MM/YYYY format. ( http://digitalbush.com/projects/masked-input-plugin/ ) My javascript code: jQuery(function($){ $(".date").mask("12/2099"); }); And HTML Code: <input type="text" class="date"> When I start to write something it take to the field the value 12/2099 and it's impossible to write other thing. If in javascript mask I write 99/9999, users could write date that is false ... so I don't what I have to do ? I want to users that they could write starting on 01/1990 until 12/2099, possible adding to the restrict with the value of

How to convert standard IP address format string to hex and long?

与世无争的帅哥 提交于 2019-12-04 12:37:43
问题 Does anyone know how to get the IP address in decimal or hex from standard IP address format string ("xxx.xxx.xxx.xxx")? I've tried to use the inet_addr() function but didn't get the right result. I tested it on "84.52.184.224" the function returned 3770168404 which is not correct (the correct result is 1412741344). Thanks! 回答1: The htonl, htons, ntohl, ntohs functions can be used to convert between network and local byte orders. 回答2: You have just got the bytes reversed from what you