Newest 'formatting' Questions - Stack Overflow

Questions tagged [formatting]

The process of transforming text or data for presentation. A typical example would be the transformation of a decimal into a particular currency format with the correct number of decimal places.

2
votes
1answer
20 views

Combining pandas rows based on condition [duplicate]

Given a Pandas Dataframe df, with column names 'Session', and 'List': Can I group together the 'List' values for the same values of 'Session'? My Approach I've tried solving the problem by creating ...
0
votes
1answer
8 views

How can i create leader lines to connect labels to symbology

My Labels are crowded, I want to space them away from the points by add leader lines to make it clear which label is for which datapoint
0
votes
0answers
16 views

Error when trying to format line spacing using variable instead of “Selection”

I want to change the line spacing to single and space before and space after = 0 only for the text that has font.size=12 and font.name = "Arial". I recorded I macro and for all times when the macro ...
1
vote
0answers
41 views

Is it possible to use a variable as fill-argument in the format! macro?

I wanted to imitate Pythons rjust, ljust, and center functions using the format! macro, but I was only able to work out a solution where you can pass in the string and the width. If you want to pass ...
0
votes
1answer
16 views

rename numbers in files

I want to rename only .csv files which do not conform to name format guidelines. All other files with incorrect numbers are ok. correct: 31_12_99-01.csv 01_01_00-88.csv incorrect: ...
0
votes
0answers
14 views

JavaScript: recreate/order Document Fragment. Remove formatting from fragment

I am building a block-based editor but have hit a wall on how to proceed. I do not want to use execCommand to do things such as bold text because I want my editor to be able to wrap selected text in ...
1
vote
1answer
37 views

AutoFitting Columns With Maximum Width Condition?

In VBA, I want to format my columns across the entire workbook to autofit the data, but with a maximum width of 50 or 75 (no preference as to which width, 50 or 75 are just suggestions). I want to do ...
0
votes
1answer
34 views

Python3: Replacing fields using .format() “{1:>2}”

Just a quick one really, I am learning Python3 at the moment and saw this {1:>2} used for a replacement field. I was wondering if someone might be able to explain what it is doing here: for i in ...
1
vote
0answers
22 views

Format Pandas DataFrame table to look better

So I have an Excel with new employees list. I use Panda to go over the list and check if there's an employee that starts working in less than 7 days. If there is, it sends out an email with the list ...
0
votes
1answer
33 views

How can I use conditional formatting to compare against a dynamic worksheet?

I am trying to use conditional formatting to compare the value of one cell against another in a dynamically referenced worksheet while using a dynamic cell reference and highlight the cell whenever ...
0
votes
2answers
25 views

Python format percentages

I use the following snippet for converting a ratio into a percentage: "{:2.1f}%".format(value * 100) This works as you would expect. I want to extend this to be more informative in edge cases, where ...
0
votes
0answers
16 views

Visual Studio Code not correctly formatting Larvel's Blade for loop

I have Visual Studio code with PHP Intelephense installed. I set it up in a way that when I hit CTRL+S to save, it automatically formats and indents the document. While working on *.blade.php files, ...
0
votes
1answer
25 views

How to fix: TypeError: unsupported operand type(s) for +: 'NoneType' and 'str'

I am attempting to create a madlibs for a small hw assignment. Trying to fix this error in line 15. I've tried using "str(None)" instead of just the plan "' '" import random print('Time for M A D ...
0
votes
1answer
29 views

Formatting Problem in a Programming Problem

uVA 382(https://uva.onlinejudge.org/index.php?option=onlinejudge&page=show_problem&problem=318) is rather simple: Given a number, say whether it's a perfect, deficient or abundant number. But ...
0
votes
2answers
31 views

Directive formatting does not keep up with fast input

I am trying to format an input field by transforming the letters by the user to valid initials: Uppercase, separated by a dot. Input has to formatted as the user types and not afterwards. new-...
0
votes
1answer
37 views

Display the last year in a choice type field

I want to display in a year field (choice type field) just the last year (every year he will choose just the year before) to extract the last year I am used to use : $year= date("Y")-1; but how ...
-2
votes
1answer
32 views

How can I format the string to have commas after 3 digits (display as number)? [closed]

I was looking at this answer and I don't understand what this part does/how it works x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ","); Can someone please explain it? I just don't get the /\B(?=(\...
0
votes
0answers
22 views

Why the field value in IP address shows as a link in Angular

I have a field in a table which shows the date, for some specific values it shows a link even though I haven't added one. It seems that my data value format is like an IP address format which is ...
0
votes
0answers
30 views

Formatting INSERT SQL statements to align column name and values

I would like to know if there is any tool(preferably online) which can format SQL statements so that the column names and values for each column is aligned e.g. I would like to format following ...
1
vote
1answer
19 views

How can I add linebreaks to a JSON file to make it more readable? [duplicate]

I want to add linebreaks to a JSON file that contains the configuration of a game I'm making. The idea is to have a list that contains stats that can be changed by anybody who wants to. The way I'm ...
1
vote
1answer
32 views

Revising a Ruby method to represent integer partition as ordered string (without flattening?)

I'm writing for help to improve the Ruby method below to convert an integer partition represented as an array of n integers (11 = [5,1,5]), where the order of the partitions matter, to string ...
0
votes
2answers
24 views

Why does output differ based on what comes before my command

The commands Write-Host "`r`nSource Hosts" -BackgroundColor Green $myEvents | Group-Object Host -NoElement | Sort-Object Count -Descending Write-Host "`r`n`r`nAccounts" -BackgroundColor Green $...
0
votes
0answers
16 views

Keep formatting when pasting content from Word document to Outlook mail

I am trying to run a macro in Excel to copy the content from a Word document, paste it in Outlook with the formatting as in the Word document, and send to an email address in an Excel cell. I have ...
0
votes
0answers
18 views

Is there a way to selectively change the max. line width of the eclipse formatter for specific sections (or files)?

I know I can turn off formatting completely with // @formatter:off/on, but I would often find it useful to have automatic formatting on, but with a much larger max. line width than usual. E.g. for ...
1
vote
5answers
62 views

Removing new line between xml tags in unix shell script

<mstr> <srt>Payment towards File# 1234</srt> <msg>info for treat sxc Pay to shankar A/C#999999 bank of ooty</msg> <ins>info for party BB Pay to kumar ...
0
votes
1answer
15 views

Why do the PointerAlignment and PointerBindsToType options not work?

I'm using clang-format (version 8.0.0 (tags/google/stable/2019-01-18)) with a style file, in which I set PointerAlignment: Left PointerBindsToType: true This succeeds in transforming ...
0
votes
2answers
20 views

Are there any changes I should make to the formatting of my code?

My teacher is telling me that I need to work on my formatting by using code blocks properly. I've edited the code and would like to know if anyone has any ideas for improvement, or if my code looks ok....
-1
votes
1answer
19 views

Are there any other way to break apart web-elements besides <br>?

Looking to substitute <br> because our automation doesn't handle elements without a pairing < / >. Are there other ways to <br> besides <br> or inserting web-elements?
1
vote
1answer
22 views

Cannot format the ticklabel in the twin x axis in matplotlib.pyplot

I would like to plot a figure with double x axis, and format the ticklabel in the upper axis to scientific notations. import numpy as np import matplotlib.pyplot as plt imp1=np.arange(0,2,2/50) ...
0
votes
1answer
41 views

Getting time of day from user for silly simple app

I am begginer in Python and I wanted to try to make myslef a simple piece of code that would take my input of time when I came to work and tell me when I get to go home. Problem is the input ...
0
votes
0answers
22 views

Excel text formatters when copying from plain text

I am looking for something like the html <b> text formatter (and others for color) to paste text into Excel, so that Excel recognizes it as "formatted" and displays it as such. My sepcific ...
-1
votes
0answers
4 views

Protect Cell Based on Color

I would like to automatically protect a cell once I shade it with a particular color. Is this possible with conditional formatting? Once I review cell data input by others, I need to ensure the data ...
0
votes
1answer
33 views

C#. String was not recognized as a valid DateTime

I have a string: string date = "2019-06-06T14:31:55.7316366+03:00"; and I'm trying to map it to DateTime: var formattedDate = DateTime.ParseExact(date, "dd/MM/yyyy", null) But I have an exception: ...
-1
votes
1answer
23 views

Reading cell value in python

I have an excel coming from external source. I have a value in a cell which is 63.999 as shown below : but in the top editing bar it is shown as 63999 as shown below : I am using openpyxl to parse ...
-1
votes
1answer
12 views

How do I avoid 'NA' values when coercing a .tsv column into numeric via as.numeric?

I have a dataframe with several columns from a .tsv file and want to transform one of them into the 'numeric' type for analysis. However, I keep getting the 'NAs' introduced by coercion warning all ...
0
votes
1answer
23 views

escaping {} brackets in triple quote Python strings [duplicate]

how can you format a string of this form in Python 3? '''{name}{{name}}'''.format(name="bob") the desired output is: bob{bob}, but the above gives: bob{name}. one solution is to add another ...
0
votes
2answers
21 views

How to align 3 divisions in a row such that the last element is at the middle of the page?

How can I align 3 divs in a row, equally spaced, such that the last (rightmost) element is at the center of the page?
0
votes
1answer
31 views

How do I format large numbers(int) in pandas dataframe?

I have a balance sheet of a company with large number which, I want to format into a small number, I have this number: 55888000000 which I need to convert into: $55.88 I Have tried this: pd....
0
votes
1answer
15 views

Formatting Lines of Text in specific order - terminal

Matching the bottom block of text with the top block of text, with some other formatting requirements. Below is an excerpt of the block of the text, this is repeated in a large file. B. Silva MID ...
0
votes
0answers
15 views

Vetur configuration to respect eslint standard

I've set up a Vue.js project using vue-cli and work on it in VS Code and Vetur. ESLint is configured with the standard profile. I'd like the 'Format Document' command to produce a format which is ...
-1
votes
1answer
36 views

How to format a Python string to resemble a dictionary using .format()? [duplicate]

I have a python variable containing the string A and another one containing the string B. I want to generate the string which represents the dictionary containing the aforementioned two strings as a ...
0
votes
0answers
8 views

How to style an XML Document to display in Excel

My Problem So, I'm writing an XML Generated Document by Some Code. I can set up all the information fine. But when it come to styling, nothing work. So I would like to know how can i write my xml ...
0
votes
0answers
7 views

Fast way to format doctests

Say I write the following function: def my_marvellous_list(my_list): return 'What a marvellous list!' and would like to add a doctest, to verify that my_marvellous_list([4, 5, 10, 7, 3, 8, 50, ...
0
votes
0answers
15 views

Formatting data from google sheet to excel

I have a function which gets a google sheet, then write it in an excel table: Function GetDataFromGoogle() Dim i As Integer With Worksheets("Listing") With .QueryTables.Add (Connection:="URL;...
0
votes
0answers
30 views

Title column of Event does not show the JSON formatting in a Calendar List in 365

I am trying to change the background color of the calendar entries based on a choice column "OOOType" (internal name) that can have the values: 'Vacation' ,'Out of Office', 'Business Travel' I want: ...
0
votes
0answers
19 views

Format ldap result into json

I need to convert ldap result into json. i have been trying for hours and I did not find any solution. search_filter = "CN=My Name" attrs = ['givenName', 'sn', 'thumbnail_pic', 'phone', 'mail'] ...
1
vote
1answer
18 views

Formula help for multiple conditions in excel conditional fomatting

I have a full case of Excel brain freeze trying to conditionally format cells. Cell A1 is a number C positive or negative A2 is the cell I want to conditionally format. Cells that dont meet any of ...
0
votes
1answer
17 views

Are tables still the preferred method of designing email templates?

I am redesigning my company's email templates and I opted to code the basic structure from scratch rather than wrestling with what has been created in the distant past. I ran into a problem ...
0
votes
0answers
15 views

How to prevent weird code formatting in VSCode

How to prevent VSCode to format function arguments like this? I have Eslint and Prettier plugins installed. Maybe some rules or preferences? This is formatted const ui = handleActions( { [...
0
votes
2answers
19 views

Convert a Long/ULong to an unsigned hexadecimal string with padding zeros

How to convert a Long/ULong representing an unsigned long to an unsigned hexadecimal string with padding zeros (a 16-digit hexadecimal string)? I am looking for a simple and neat solution in Kotlin ...