Questions tagged [formatter]

A formatter may be any program or piece of program that modifies a file or input text so that it complies to a given format, or generate a text in a given format from input data. Examples include: formatting a date to a localized format; indent a source code; replace variables in a string with inputted values; etc.

formatter
Filter by
Sorted by
Tagged with
0 votes
1 answer
173 views

DecimalFormatter with a custom pattern

I'm creating a custom formatter where I want to avoid using the Locale, so having a groupingSeparator, decimalDelimiter configure the decimalFormatter with the configured values. But when I want to ...
0 votes
2 answers
184 views

confused about formatter in numpy. set_printoptions

I encountered the following piece of code: z=np.arange(0,12) np.set_printoptions(formatter=dict(int=lambda x: f'{x:4}')) print(z) I understand what the code is doing but I am not clear as to what the ...
0 votes
0 answers
90 views

Textfield custom `Formatter` failing to show custom currency text as prefix

I would like to create a custom Formatter to TextField. Here I have done some workaround but it's not working as expected. We should show text in the formate of USD$ 200.00. USD$ prefix should show in ...
1 vote
1 answer
1k views

How to write a custom formatter in VSCode that inherits from existing formatters?

I have HTML code with YAML front matter for content and I would like to format both parts concurrently. I have created a custom syntax and highlighting works well. How to register a new formatter for ...
0 votes
1 answer
6k views

Formatter Black not working for my VScode Jupyter Notebooks?

My black formatter that used to work to format my notebook cells on autosave (after delay) is no longer working since months ago even though autopep8 is working. I use a virtual environment to work ...
0 votes
0 answers
151 views

Eclipse code formatting: Line width ignored for some situations

In my eclipse formatter i set the eclipse max line width to 140 unfortunately that does not count for something like this where the given text width is longer than 140: assertThat(rte.getMessage(), ...
6 votes
0 answers
4k views

Error: ESLint configuration in --config is invalid

I am facing the error while using the command npm run start: Error: ESLint configuration in --config is invalid:- Unexpected top-level property "compilerOptions". I cannot figure out the ...
0 votes
1 answer
93 views

jdt.core CodeFormatter - formatting blocks of comments

I am using org.eclipse.jdt.core.formatter.CodeFormatter class. I have problem with formatting properly comments. Can anyone tell what options from DefaultCodeFormatterConstants should I use to format ...
0 votes
2 answers
236 views

Java Formatter: old formatted values are kept

I use the following formatter: protected static final ThreadLocal<Formatter> textFormatter = new ThreadLocal<Formatter>() { @Override protected Formatter initialValue() { ...
0 votes
0 answers
472 views

VSCode use different formatter conditionally

I'm using eslint and prettier plugins for vscode, both of them offer code formatting. I prefer eslint formatting because it formats according to eslint rules so I made it my default formatter. But ...
7 votes
2 answers
22k views

SwiftUI Date formatting

i take this from Github: https://github.com/emilioschepis/techfeed When i start the app, i getting a issue in the console: Could not convert "Wed, 03 Aug 2011 09:44:00 +0200" to Date. and i ...
8 votes
1 answer
503 views

How to generate HTML reports from minitest specs

Is there a reporter for minitest to generate HTML from minitest spec-runs? Or do I miss a built-in feature or flag? Rspec has formatters to generate HTML documentation, but I cannot find this for ...
0 votes
2 answers
1k views

Using ValueFormatter in MP Chart but it does not taking effect

Using MP Chart in Android. Reference : https://github.com/PhilJay/MPAndroidChart I have to display 30.8351 as 30.83 on the BAR Chart. So I found that We can do it with the use of Value Formater in MP ...
1 vote
1 answer
767 views

Passing the cell variable into the onclick method of a custom icon event Tabulator

I'm using Tabulator to create tables. I have a delete icon (custom trash icon) for every row. But triggering onclick event on the custom icon isn't working. Here is my code: {formatter: deleteBtn, ...
0 votes
1 answer
2k views

SharePoint JSON Formatter Boolean as Yes No

With JSON formatter, how do you make a the content of a boolean Yes No instead true false? "$schema": "https://developer.microsoft.com/json-schemas/sp/column-formatting.schema.json"...
11 votes
1 answer
7k views

What does "esbenp" stand for in Prettier config in settings.json?

"editor.defaultFormatter": "esbenp.prettier-vscode", I see esbenp a lot, but it's really hard to find what it stands for. What does does it mean?
0 votes
1 answer
1k views

"There is no formatter for 'java' files installed" message when trying to format my Java code

I've tried countless things I've seen online today, but I just can't get the RedHat Java Support extension to format the code. It used to work for me in the past. At some point today, I completely ...
0 votes
1 answer
222 views

Swift 5: Add decimal separators whitout NumberFormatter

I need to create a function to add the decimal and thousands separators to a number that is a string, I know I could use numberFormatter but I want to practice another way of doing it. For example if ...
1 vote
0 answers
334 views

Pandas dataframe - different float format for different columns

I have a list of dicts: list_of_dict = [ {'Name': 'Shaun' , 'Rating': 35.0, 'Marks': 9.10 }, {'Name': 'Suzy' , 'Rating': 31.5, 'Marks': 8.7 }, {'Name': 'Ray' , 'Rating': 33 , '...
0 votes
0 answers
201 views

Is there a python linter/formatter that allows and enforces leading commas?

Is there any python linter/formatter option that allows or even enforces leading commas on lists and multi-line function arguments? I love everything that black does, but anything to do with a comma ...
1 vote
0 answers
145 views

How to get the code formatter to not indent try/except blocks

Using Delphi 10.2.3, I've got the code formatter set up the way I want it, with one exception: while it formats if-then begin/end blocks without adding a line break before the begin or adding extra ...
0 votes
0 answers
250 views

java Unparseable date "yyyy MMM d HH:mm:ss" [duplicate]

I am a beginner and i want to convert this String into a Date Instance. Why get i an unparsable Exception ? Can anyone help me ? String s= "2020 Mar 11 11:09:42"; SimpleDateFormat formatter ...
2 votes
0 answers
68 views

How to format a new line for each condition, only if more than two conditions (Eclipse)

How can I configure Eclipse formatter to format chained conditions automatically (ctrl + shift + f) like // if only two conditions -> same line if (true && true) { doSomething(); } // ...
0 votes
4 answers
914 views

Convert timestamp to string without formatter

I get a TIMESTAMP from an Oracle DB in this format: yyyy-MM-dd hh:mm:ss.SSS and would like to convert to a String like dd.MM.yyyy. I performed string operations and the result was correct as expected. ...
0 votes
0 answers
648 views

Can I put the property visible to an icon that is inside a text? SAPUI5

What I'm trying to do is put in only column the information about the hour, date and an icon that indicates if something changed in the last hour. So I need that this icon only show in the web when ...
3 votes
1 answer
8k views

Format/beautify bigquery code (like procedures)

Do we have any tool to format/beautify bigquery code formatter? Any standalone or open source code? I did not find anything particular for big query.
3 votes
2 answers
1k views

Formatter parameter passes as null

I am trying to export table data to an Excel sheet. Everything works OK without formatter. But I have to format some cells before converting table to Excel. I'm debugging the code. Formatter function'...
0 votes
0 answers
18 views

Transplant VScode setting to other

Please be aware that I'm unfamiliar with those tools. I'm currently working with VScode and I have two settings with the same server, but the different users. At first, I set up 'the first user' and ...
0 votes
0 answers
377 views

Intellij IDEA setting for "method call argument:s chop down if long" misbehaving

Whenever I call a method that has too many arguments and the line exceeds the margin, I need it to put each of the params on separate lines. My settings: Original code: return getSubscriptionList(...
-3 votes
1 answer
81 views

How can I format wordpress text code to be easer to read?

I have this jumbled mess and it's so frustrating to format it so it's easer to read and to edit it. What extension I can use for visual studio code to format it properly? Before this I made page like ...
6 votes
1 answer
2k views

how to change the line wrap setting of Black (Python formatter)?

I'm using black as my python formatter, and when there's a long list in my code, black will format this list, causes it takes much lines to place this list like this : city_order_list = [ 1, ...
2 votes
1 answer
818 views

Date and Time formatting using Formatter class in java

I'm stuck in a problem, I know that we can use SimpleDateFormat class or other format classes in java to format the date/time. But I'm trying to format the time and date using Formatter class method ...
0 votes
2 answers
409 views

Eclipse PHP formatter for CakePHP

In Eclipse In Window->Preferences->PHP->Code Style->Formatter I want to import for CakePHP instead of PHP but I haven't find in the file in format XML. I appreciate you in advanced. It should be a ...
0 votes
1 answer
535 views

How to store a time interval with HH:MM:SS:MS swift

So this turned out to be way more complex than I was I expecting. I have four text fields that allows the user to enter HH:MM:SS:MS and I need to mash these together to create a number I can save in ...
0 votes
1 answer
448 views

google is not defined in Angular Project using google-charts

i using google-charts in my angular project. i need to format the values into my chart and i have found this documentation: https://github.com/FERNman/angular-google-charts#formatters my code is this: ...
0 votes
0 answers
1k views

Does Prettier have a way to specifically ignore certain lines of code in a file?

We are using TestCafe for our E2E testing purposes and wanted to implement a formatter so all contributors push the same style code up. I have Prettier up and running and have some config rules in ...
1 vote
0 answers
287 views

VS Code Formatter braces on new line for css and scss

In VS Code formatter, searched a lot to format CSS and SCSS and put the braces in a new line as below, But dint find any. Can anyone help on this. :root { --brandColorVar: #056ca1; } @font-face ...
68 votes
7 answers
57k views

Double parameter with 2 digits after dot in strings.xml?

I want to have a parameter in one string in strings.xml and this parameter should be a double value. So I use %1$f. Here - http://developer.android.com/reference/java/util/Formatter.html there are ...
1 vote
1 answer
8k views

How do i modify a log format with Simple Formatter?

I've tried adding this line into logging.properties, but the output doesn't change java.util.logging.SimpleFormatter.format='%1$tY-%1$tm-%1$td %1$tH:%1$tM:%1$tS %4$s %2$s %5$s%6$s%n' I also tried ...
0 votes
1 answer
180 views

Exclude formatting

Is there a way to exclude next node/line in Javascript/react from formatting with native visual studio code formatter like it is possible with Prettier extension? With Prettier, this comment ignores ...
1 vote
2 answers
2k views

VSCode PhpStorm formatter fails

I have installed PhpStorm formatter in VSCode (latest update) and we have PhpStorm installed on the computer I work with. I went to preferences/settings and I set the "Editor:default formatter" to ...
1 vote
1 answer
548 views

How can I check if the first index in this string is = '1' and then remove it?

I am creating a phone number formatter and all is working except this part. The error I am running into is this: "TypeError: Cannot read property 'indexOf' of undefined". I tried using ....
-1 votes
1 answer
1k views

Formatter function not working properly inside Input Control

I need to highlight a few of the table's cell border colors on the basis of a condition and pre-fill it with some negative value. Then I need to SAVE/POST this value to proceed further. View.xml <...
0 votes
1 answer
847 views

How can I set a standard linter,formatter and settings for a project and save those to the git repo?

I want others who clone the repo to have these settings, right now I have a settings/.vscode file with these settings { "files.exclude": { "*/__pycache__": true, ...
-3 votes
2 answers
64 views

Why does converting a Date from a String Object to a Date Object is always nil in Swift [closed]

I have the following Date string 2021-08-06T22:46:31+02:00 I am trying to convert it to a Date object using the following code but it is always nil let dateFormatter = DateFormatter() ...
0 votes
0 answers
22 views

Simple example how to redirect logging messages with flask? [duplicate]

I want to use an existing (big) python app (let's call it my_backend.py) with a web browser. For that, I've added a small python file using flask (+ templates/index.html). It's work...but now I'd like ...
0 votes
1 answer
147 views

Is there A Java Function or Library to Insert formatted Text into arbitrary file?

Trying to create a function that will Append content to lines in a file that match a certain regex condition AccountFile.txt 1 { 2 "account": "123456", 3 "...
0 votes
1 answer
1k views

react-jsx-highcharts with functional component and formatter

I am testing the react-jsx-highcharts possibilities with a polar chart. Versions: React: 17.0.1 react-jsx-highcharts: 4.2.0 typescript: 4.0.3 I am using the functional components. So, I don't have any ...
0 votes
1 answer
23 views

Zapier Formatter - Hashtags Words In A String With Exemptions

I am looking to automate my social-media hashtags in Zapier, dependent on the post title. Input: High School English As A Second Language Teacher Output: #High #School #English #Second #Language #...
0 votes
1 answer
888 views

How to bind an observable objects published integer variable to a textField in SwiftUI?

I have a viewmodel class like so: class SharedViewModel: ObservableObject { @Published var objectHeight: Int? = nil } and I am trying to bind to bind the variable to a textfield with a number ...

1 2 3
4
5
18