UPDATED ANSWER:

You can compose multiple format specifiers. Below, +.1f is used to keep the sign, and print to only 1 decimal place. and <10 is used to justify the string.

values = [-1.0, 2.2]

for value in values:
    print(f"someLjustedStrings{value:<+10.1f}someLjustedStrings")

OLD ANSWER:

You can try this:

values = [-1.0, 2.2]

for value in values:
    print(f"someLjustedStrings{['+', '-'][value<0]}{abs(value):<10}someLjustedStrings")

Output:

someLjustedStrings-1.0       someLjustedStrings
someLjustedStrings+2.2       someLjustedStrings

< followed by int for ljust

> followed by int for rjust

EDIT:

If you want to ljust by variable:

LJUST = {'value': 10}
values = [-1.0, 2.2]

for value in values:
    print(f"someLjustedStrings{['+', '-'][value<0]}{abs(value):<{LJUST['value']}}someLjustedStrings")

Output:

someLjustedStrings-1.0       someLjustedStrings
someLjustedStrings+2.2       someLjustedStrings
Answer from Sayandip Dutta on Stack Overflow
🌐
W3Schools
w3schools.com › python › ref_string_ljust.asp
Python String ljust() Method
Note: In the result, there are actually 14 whitespaces to the right of the word banana. The ljust() method will left align the string, using a specified character (space is default) as the fill character.
🌐
Programiz
programiz.com › python-programming › methods › string › ljust
Python String ljust()
The string ljust() method returns a left-justified string of a given minimum width.
🌐
GeeksforGeeks
geeksforgeeks.org › python › python-string-ljust-method
Python String ljust() Method - GeeksforGeeks
July 23, 2025 - Python ljust() method is used to left-justify a string, padding it with a specified character (space by default) to reach a desired width.
🌐
Tutorialspoint
tutorialspoint.com › python › string_ljust.htm
Python String ljust() Method
The Python String ljust() method is used to left align the string with the width specified. If the specified width is more than the length of the string, then the remaining part of the string is filled with fillchar.
🌐
Python Reference
python-reference.readthedocs.io › en › latest › docs › str › ljust.html
ljust — Python Reference (The Right Way) 0.1 documentation
ljust · Edit on GitHub · Returns the string left justified in a string of specified length. str. ljust(width[, fillchar]) width · Required. The width of the field containing the string. fillchar · Optional. Specifies the padding character (default is a space).
🌐
GeeksforGeeks
geeksforgeeks.org › python › python-string-ljust-rjust-center
Python String - ljust(), rjust(), center() - GeeksforGeeks
January 2, 2025 - The return type of ljust() is a new string that is left-justified with padding.
🌐
AskPython
askpython.com › python › string › python-string-ljust-rjust-functions
Python String ljust() and rjust() functions - AskPython
April 5, 2023 - The Python string ljust() function accepts characters for padding in an input string by adding it to the right of the input string.
🌐
Toppr
toppr.com › guides › python-guide › references › methods-and-functions › methods › string › ljust › python-string-ljust
Python ljust() function | Why do we use Python String ljust() function? |
September 27, 2021 - Python ljust() is a built-in function that returns a left-justified string according to the width specified and fills the remaining spaces with blank spaces if the character argument is not passed.
Find elsewhere
🌐
Javatpoint
javatpoint.com › python-string-ljust-method
Python String | ljust() method with Examples - Javatpoint
Python Function Programs · capitalize() casefold() center(width ,fillchar) count(string,begin,end) encode() endswith(suffix ,begin=0,end=len(string)) expandtabs(tabsize = 8) find(substring ,beginIndex, endIndex) format(value) index(subsring, beginIndex, endIndex) isalnum() isalpha() isdecimal() isdigit() isidentifier() islower() isnumeric() isprintable() isupper() isspace() istitle() isupper() join(seq) ljust(width[,fillchar]) lower() lstrip() partition() replace(old,new[,count]) rfind(str,beg=0,end=len(str)) rindex(str,beg=0,end=len(str)) rjust(width,[,fillchar]) rstrip() rsplit(sep=None, ma
🌐
Learn By Example
learnbyexample.org › python-string-ljust-method
Python String ljust() Method - Learn By Example
April 20, 2020 - The ljust() method returns left-justified string of length width. Padding is done using the specified fillchar (default is an ASCII space).
🌐
Python Principles
pythonprinciples.com › blog › string-ljust-explained
Python String ljust() explained – Python Principles
The method lets you pad a string with characters up to a certain length. The ljust method means "left-justify"; this makes sense because your string will be to the left after adjustment up to the specified length.
🌐
Vultr Docs
docs.vultr.com › python › standard library › str › ljust()
Python str ljust() - Left-Justify String
December 26, 2024 - The str.ljust() method in Python is a straightforward yet versatile function used for string manipulation, specifically for left-justifying text within a specified width.
🌐
LearnModernPython
learnmodernpython.com › home › python string ljust(): a beginner’s guide to left justification
Python String Ljust(): A Beginner's Guide To Left Justification
March 5, 2026 - Proper alignment, achieved through padding, would make this much clearer. This is where string formatting methods, like ljust(), come into play. The ljust() method in Python is used to left-justify a string within a given width.
🌐
TutorialKart
tutorialkart.com › python › python-string-ljust
Python String ljust() - Examples
April 3, 2023 - Python String ljust() is used to left align the given string in specified space (length) and optionally fill the left out space with the specified character.