Tags "format" Result

What kind of data format is that?

I found this record in the database which is used to hold multiple values. I want to know what is this format called so that I know how to deal with it? a:4:{s:5:"child";a:1:{s:0:"";a:1:{s:3:"rss";a:1:{i:0;a:6:{s:4:"data";s:1:" ";s:7:"attribs";a:1:{s:0:"";a:1:{s:7:"version";s:3:"2.0";}}s:8:"xml_base";s:0:"";s:17:"xml_base_explicit";b:0;s:8:"xml_la

it1352 0 2020-07-23

Decimal money format

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? Solution 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 val

it1352 0 2020-07-23

Java date format

Have String str "May 23 2011 12:20:00", want to convert it to date such this: Date date = (new SimpleDateFormat("MMM dd yyyy HH:mm:ss")).parse(str); It always gives me ParseException Unparsable date format: 'May 23 2011 12:20:00'. Looked for similar issues, seems everything right. What is wrong? Solution You may need to additionally specify t

it1352 1 2019-05-22

PHP format date

How can I force the date format to output: 12/12/2012, 1/10/2012, 1/5/2012 instead of 12/12/2012, 01/10/2012, 01/05/2012? My code is the following: $adatefrom = date_create($_POST['datefrom']); $adateto = date_create($_POST['adateto']); $adatefrom = date_format($adatefrom, 'd/m/Y'); $adateto = date_format($adateto, 'd/m/Y'); Please do note

it1352 0 2019-05-15

DateTime::createFromFormat in PHP < 5.3.0

I'm looking for a function identical to DateTime::createFromFormat but I need it to work in an environment running a version of PHP which is older than v5.3. Basically I need to provide a format, like you'd use with the Date() function, and I then need to parse/validate a string against that format, and return a timestamp if the string is formatted

it1352 3 2019-05-15

How to format the printing of doubles

Im making a division table from 1-10 an the results range from integers to x.x to x.xx i used decimalformat to keep the the numbers to 2 decimal places but that throws off the format of the table. How would i print the numbers so that they would all be x.xx for example 1 -> 1.00 0.5 -> 0.50 0.333... -> 0.33 DecimalFormat df = new Decimal

it1352 1 2019-05-17

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

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

it1352 1 2020-07-23

git log format: shift commit body X columns to the right

I'm using the following custom log format to view my commits: Command: git log --pretty=format:"%C(auto)%h %<(8,trunc)%aN %Cgreen%s % b" 3758d35 Daniel This commit does nothing You really should remove it before commiting. 1. This is a line 2. This is another line a191c2b Daniel Viral helvetica lomo, typewriter fashion axe 814a

it1352 1 2020-07-23

How to tell eclipse to not format parts of a codefile (pressing Strg Shift F)

I really love the autofromat feature. I makes your code more readable and in case of JavaScript tells you, when there are synatcs errors (missing brackets etc.). However sometimes the formatting makes the code harder to read. e.g. when it puts a long array inizalisation into a single line. In that case I don't want him to format it, but rather lea

it1352 0 2019-05-15