humanize Questions
12
Solved
I want to standardize a user-supplied string. I'd like the first letter to be capitalized for the name and if they have entered two last names, then capitalize the first and second names. For examp...
Fungus asked 4/1, 2012 at 23:50
3
Solved
I am building an application with Ruby 1.9.3 and Rails 3.0.9
I have a class like below.
module CDA
class Document
def humanize_class_name
self.class.name.gsub("::","")
end
end
end
I want t...
Dignitary asked 10/9, 2012 at 10:55
5
Solved
How do I humanize a string? Based on the following criteria:
Deletes leading underscores, if any.
Replaces underscores with spaces, if any.
Capitalizes the first word.
For example:
this...
Argentite asked 5/2, 2015 at 4:13
5
Solved
I'd like a way to show natural times for dated items in Python. Similar to how Twitter will show a message from "a moment ago", "a few minutes ago", "two hours ago", "three days ago", etc.
Django ...
Unprepared asked 4/1, 2009 at 1:20
9
Solved
I could write my own algorithm to do it, but I feel there should be the equivalent to ruby's humanize in C#.
I googled it but only found ways to humanize dates.
Examples:
A way to turn "Lorem ...
4
Solved
When I do this:
{% load humanize %}
{{ video.pub_date|naturaltime|capfirst }}
I get 2 days, 19 hours ago
How can I get just 2 days without the hours. Basically if the video was published in le...
12
Solved
I'd like to write a method that converts CamelCase into a human-readable name.
Here's the test case:
public void testSplitCamelCase() {
assertEquals("lowercase", splitCamelCase("lowercase"));
a...
Existential asked 1/4, 2010 at 10:42
4
Solved
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 r...
Ski asked 4/3, 2012 at 2:35
1
I would like to use the django.contrib.humanize outside of a template, actually inside a model to humanize some dates in some text messages.
Is it possible? How can I do this?
5
Solved
I have a requirement to format large numbers like 4,316,000 as "4.3m".
How can I do this in C#?
Griffon asked 12/10, 2009 at 16:0
3
Solved
I'm trying to calculate remaining time (ex: 10 years, 2 months and 10 days from today(2014/03/02) in JS using this function:
var d2 = new Date(2024, 3, 12);
var d1 = new Date();
var d0 = new Date(...
Vereen asked 2/3, 2014 at 17:34
1
Solved
I know I can use the humanize module to convert date/time to a friendlier format in the django templates. I was wondering if I can convert those things outside the templates. For example in a views...
Manilla asked 21/6, 2013 at 2:22
4
Solved
I would like to print my very small numbers in C# in a human friendly way, such as:
30µ for 3E-5 or 456.789n for 0.000000456789.
I know of the Humanize_number() function from BSD in C, but ...
Hypnotherapy asked 18/4, 2013 at 13:0
5
I would like to know more about the solutions to restrict registering for a website for humans only.
Captcha may seem a proper solution but as it turns out it's not as good as it sounds.
And it's...
Wilding asked 18/9, 2012 at 18:20
2
Is there a function to 'reverse humanize' times?
For example, given (strings):
'1 minute ago'
'7 hours ago'
'5 days ago'
'2 months ago'
Could return (apologies for the pseudo-code):
datetime...
1
© 2022 - 2024 — McMap. All rights reserved.