Questions tagged [humanize]

To humanize is to make something friendlier to humans. Humanizing makes things more civilized, refined, and understandable.

44 questions
0
votes
0 answers

Python Humanizing is failing at numbers above a googol

So, i am using Humanize in Python and Nextcord for a discord bot to shorten my Numbers with many zeros in a json file. When i am humanizing it with following code: import humanize def humanizing(num): num = humanize.intword(num) num =…
Navis
  • 77
  • 5
0
votes
1 answer

MetricNumeralExtensions.ToMetric is obsolete, use MetricNumeralFormats?

We've upgraded Humanizer from 2.8.26 to 2.11.10 and now get the following warning: 'MetricNumeralExtensions.ToMetric(double, bool, bool, int?)' is obsolete: 'Please use overload with MetricNumeralFormats' Are there any examples on how to use…
aloisdg
  • 22,270
  • 6
  • 85
  • 105
0
votes
1 answer

How to humanize measurement queries in Django

I have a distance query in Django and prints a distance with several decimal points. It displays distance in a measurement format as 1023.40258027906 m .I want to make this human readable. I tried using Decimal but this failed as it does not apply…
Kaleab Woldemariam
  • 2,567
  • 4
  • 22
  • 43
0
votes
1 answer

Round last value in humanize-duration formatted value (React)

I am setting up a table in React that applies humanize-duration to a value (the library applies ms and my data is in s, hence the multplier). {humanizeDuration(time_inventoried*1000, { units: ['y', 'mo', 'w', 'd'] }) } The value I'm…
Boucherie
  • 541
  • 4
  • 20
0
votes
1 answer

Django naturaltime tag

I want to receive time difference,so I have added 'django.contrib.humanize' to Installed Apps, and '{% load humanize %}' to my template, and use it in as below: {% for notification in request.session.notifications %}
  • Natiq Vahabov
    • 495
    • 4
    • 13
  • 0
    votes
    1 answer

    How can I use elasticsearch to search with special commands in query?

    I have an elastic index with many documents. A document represents some event. Every event has a date and geolocation. I would like to send queries like these: "Some event in LA", "Some event tomorrow", "Some event near me"... How could I build this…
    0
    votes
    1 answer

    Human to PHP time interpreter

    We've got a collection of messy data, and trying to unify it. Lots of services let you type dates out into different formats and they correctly understand them, but cant think what the process is called, or how we could go about doing this in PHP,…
    owenmelbz
    • 6,180
    • 16
    • 63
    • 113
    0
    votes
    1 answer

    Error with Humanizer.Js

    I recently tried Humanizer.Js. I added a nuget reference of the same from here, and added it in my page as . However in my page load I am getting an error: "Uncaught TypeError: Cannot read…
    Sayan Pal
    • 4,768
    • 5
    • 43
    • 82
    0
    votes
    1 answer

    How to humanize child input in Rails?

    @trainer = Trainer.new(trainer_params) @trainer.name = @trainer.name.humanize @trainer.surname = @trainer.surname.humanize This bit works fine, but I would also like to apply the same thing to Sportist which belongs_to :trainer…
    Xeen
    • 6,955
    • 16
    • 60
    • 111
    0
    votes
    3 answers

    Display humanized time output

    I am trying to display following message in one of my application to show the waiting time 2 hours, 3 mins and 4 s 1 hour and 2 s As you can see there can be many variations and I am struggling to get this done. The following code works well is…
    mtk
    • 13,221
    • 16
    • 72
    • 112
    0
    votes
    1 answer

    Rails datetime interval humanize

    I want to write beautiful datetime interval. If just write something like "from #{date_start.strftime('%d.%m.%Y %H:%M')} till #{date_end.strftime('%d.%m.%Y %H:%M')}"` But in some situations this will looking bad. In example: from 14.08.2012…
    Michael
    • 548
    • 8
    • 30
    -1
    votes
    1 answer

    How do I use Django's naturaltime package in a React frontend?

    I would like to use the Django naturaltime functionality from the humanize package, or something similar, in my React frontend. Here is my current code:

    {user.username} {post.created_at}

    Here is what I'm currently…
    logan
    • 15
    • 5
    -2
    votes
    4 answers

    Simple algorithm to alternate days

    I need to alternate between 2 tasks every day, and I need a simple algorithm to know which task I need to do. I need to be able to run this algorithm by head, using simple general knowledge (like day of week, day of month, etc), and it must not rely…
    Thierry J.
    • 2,148
    • 16
    • 23
    -2
    votes
    1 answer

    Reversing the result of Django's naturaltime

    Django's humanize module is fantastic for turning datetime objects into something that makes more sense to us as humans with it's naturaltime function (docs). What I'm trying to do is the reverse, taking any one of the naturaltime formats and…
    Jamie Bull
    • 12,889
    • 15
    • 77
    • 116
    1 2
    3