An open API service indexing awesome lists of open source software.

https://github.com/gcarreno/fp-humanize

A Lazarus package to humanize some values like Bytes, Numbers, Ordinals and Time
https://github.com/gcarreno/fp-humanize

formatter formatting formatting-data formatting-text formatting-time fpc free-pascal freepascal humanize humanizer lazarus lazarus-package package

Last synced: 4 months ago
JSON representation

A Lazarus package to humanize some values like Bytes, Numbers, Ordinals and Time

Awesome Lists containing this project

README

          

# Lazarus Humanize Package
[![Build Status](https://github.com/gcarreno/fp-humanize/actions/workflows/main.yaml/badge.svg?branch=main)](https://github.com/gcarreno/fp-humanize/actions)
[![Supports Windows](https://img.shields.io/badge/support-Windows-blue?logo=Windows)](https://github.com/gcarreno/fp-humanize/releases/latest)
[![Supports Linux](https://img.shields.io/badge/support-Linux-yellow?logo=Linux)](https://github.com/gcarreno/fp-humanize/releases/latest)
[![Supports macOS](https://img.shields.io/badge/support-macOS-black?logo=macOS)](https://github.com/gcarreno/fp-humanize/releases/latest)
[![License](https://img.shields.io/github/license/gcarreno/fp-humanize)](https://github.com/gcarreno/fp-humanize/blob/main/LICENSE)
[![Latest Release](https://img.shields.io/github/v/release/gcarreno/fp-humanize?label=latest%20release)](https://github.com/gcarreno/fp-humanize/releases/latest)
[![Downloads](https://img.shields.io/github/downloads/gcarreno/fp-humanize/total)](https://github.com/gcarreno/fp-humanize/releases)

This package provides functions to humanize the following:
- Bytes: Both base 2 and base 10 - B, KB... B, Kib...
- Comma:
- Thousands separator for integers and reals( with precision )
- Turn an array of strings into a comma separated string with sorting
- CommaAnd: Turn an array of strings into a comma separated string with sorting, with the last 2 items having a `and` between them
- Ordinals: 1st, 2nd, 3rd, Nth
- Time: 1 second ago, 1 second from now, etc

There's a comprehensive demo: [Demo Folder](demo)

You can find the package here: [Package Folder](packages/Lazarus/)