To humanize is to make something friendlier to humans. Humanizing makes things more civilized, refined, and understandable.
Questions tagged [humanize]
44 questions
2
votes
1 answer
Python's humanize timedelta() tells me that minimum_unit is an invalid argument?
I am trying to print the approximate time difference between two dates. In the really well answered question here: Format timedelta to string several answers were given, and I can use one of those to solve my issue.
However, I really liked the…

Maxim Moloshenko
- 336
- 3
- 17
2
votes
2 answers
Forcing "humanized" names of fields to be lowercase in Rails 3
As far as I know, the accepted way to set the "humanized" names of fields in Rails 3 is to use locales:
# config/locales/en.yml
en:
activerecord:
attributes:
member:
username: 'username' # rather than 'Username'
However, I…

ClosureCowboy
- 20,825
- 13
- 57
- 71
2
votes
2 answers
How do I set human readable attribute names in a rails model?
This seems like a really simple question -- when I'm using form_for or fields_for helpers to generate markup from my models, how can I modify my model to customize the string that appears for a particular attribute?
More or less the same question…

kdt
- 27,905
- 33
- 92
- 139
2
votes
1 answer
Using humanize to convert numeric into words in rails
I have some amount in numeric for e.g 75.00 and I am trying to convert it into words, for that I used humanize
75.humanize
But it keeps throwing error "undefined method humanize error for 75:Float"

Shilpi Agrawal
- 67
- 1
- 12
2
votes
1 answer
Python Number to Word e.g 10K, 10.65M
I've looked into a few ways of representing numbers in a small space (in Django) and whilst their django.contrib.humanize.intword works great, i'd prefer if it said M instead of million for example. I know this wouldn't work with exceptionally large…

Callum
- 1,136
- 3
- 17
- 43
1
vote
0 answers
How to convert ISO duration and humanize it
I have an ISO value of duration, that I need show like "XX years, XX months, XX days". I use for it luxon and humanize-duration. Duration.fromISO() works fine, but humanize-duration converting went wrong.
Could you help please?
transform(value:…

Mike S
- 13
- 4
1
vote
1 answer
Use Humanize.intword function in every row and numeric column of a dataframe
I have a dataset with very big numbers. I would like to facilitate reading by using the humanize.intword function in all columns except the date.
When I select only one column, it works:
pred_df["Predictions"].apply(lambda x:…

jessirocha
- 457
- 4
- 15
1
vote
0 answers
Translating humanize text in Django
I have some issues while trying to translate in django (on the front end)
So I have a Contact model that has a bunch of messages. Each message has a "contact_date" field which I convert using humanize on the front end.
{{ message.contact_date |…

Daniel
- 131
- 1
- 9
1
vote
1 answer
humanize input javascript jquery
I want to title case form inputs using the humanize library and Jquery. So far I have this:
$("#FirstName,#LastName").blur(function () {
Humanize.titleCase( $(this) )
});
but it gives me an error:
humanize.min.js:2 Uncaught TypeError: n.split…

Emrys
- 17
- 4
1
vote
2 answers
Title-case words that are separated by underscores
I'm trying to transform a string to TitleCase before inserting it into my database. I'm using ucwords.
My strings are like: FIRST_SECOND_THIRD
My code:
if (//something){
$resp = strtolower($line[14]);
$resp_ = ucwords($resp, "_");
…

RidRoid
- 961
- 3
- 16
- 39
1
vote
1 answer
How translate humanize django
I need translate humanize to portuguese (pt-BR). How?
Import:
from django.contrib.humanize.templatetags.humanize import naturaltime
Using:
_question['pub_date'] = naturaltime(question.pub_date)
Settings:
LANGUAGE_CODE = 'pt-BR'
TIME_ZONE =…

GIA
- 1,400
- 2
- 21
- 38
1
vote
3 answers
'd' instead of 'days' in Django naturaltime
I'm workin in a mobile application with DRF as backend and using naturaltime built-in function, but since this is a mobile app, screen space is a big problem (atleast for me). So for an arbitrary date I get:
"1 week, 2 days ago"
Which is nice, but…

Gocht
- 9,924
- 3
- 42
- 81
1
vote
1 answer
django ifequal naturalday
I'm not sure why, but this condition will never evaluate True for me. I'm feeding it datetime.today() in the urls file. Am I missing something?
Template:
{% load humanize %}
{{ entry.date|naturalday }} {# Evals to "today" #}
{% ifequal…

Scott
- 3,204
- 3
- 31
- 41
1
vote
1 answer
javascript custom humanize filter
I am stuck with creating custom humanize function for my project.
My API is returing labels that I want to turn into more readable such as:
probabilityOfDefault
and I want to change it into
Probability Of Default
or
historicalDate
and change it…

Michał Lach
- 1,291
- 4
- 18
- 37
0
votes
4 answers
Capitalize last names including exceptions like mccall => McCall
I am having trouble with the capitalization of names using PHP. There are some names that have 2 capital letters in them (ex: McCall). When storing a users name that registers for our website, we run the following code:
$name =…

three3
- 2,756
- 14
- 57
- 85