{"id":39480101,"url":"https://github.com/neuron-php/formatting","last_synced_at":"2026-01-20T18:01:09.191Z","repository":{"id":57025766,"uuid":"258262772","full_name":"Neuron-PHP/formatting","owner":"Neuron-PHP","description":"Formatting objects for multiple data types. ","archived":false,"fork":false,"pushed_at":"2026-01-13T18:09:59.000Z","size":71,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"develop","last_synced_at":"2026-01-13T19:23:29.475Z","etag":null,"topics":["data-formatting","php8"],"latest_commit_sha":null,"homepage":"https://neuronphp.com","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Neuron-PHP.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2020-04-23T16:21:56.000Z","updated_at":"2026-01-13T18:10:03.000Z","dependencies_parsed_at":"2022-08-23T15:00:13.039Z","dependency_job_id":null,"html_url":"https://github.com/Neuron-PHP/formatting","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/Neuron-PHP/formatting","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Neuron-PHP%2Fformatting","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Neuron-PHP%2Fformatting/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Neuron-PHP%2Fformatting/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Neuron-PHP%2Fformatting/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Neuron-PHP","download_url":"https://codeload.github.com/Neuron-PHP/formatting/tar.gz/refs/heads/develop","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Neuron-PHP%2Fformatting/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28607961,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-20T16:10:39.856Z","status":"ssl_error","status_checked_at":"2026-01-20T16:10:39.493Z","response_time":117,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["data-formatting","php8"],"created_at":"2026-01-18T05:06:19.649Z","updated_at":"2026-01-20T18:01:09.165Z","avatar_url":"https://github.com/Neuron-PHP.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![CI](https://github.com/Neuron-PHP/formatting/actions/workflows/ci.yml/badge.svg)](https://github.com/Neuron-PHP/formatting/actions)\n[![codecov](https://codecov.io/gh/Neuron-PHP/formatting/branch/develop/graph/badge.svg)](https://codecov.io/gh/Neuron-PHP/formatting)\n\n# Neuron-PHP Formatting\n\n## Overview\n\n## Installation\n\nInstall php composer from https://getcomposer.org/\n\nInstall the neuron formatting component:\n\n    composer require neuron-php/formatting\n\n\n## Formatting\n\n### Currency\n\nFormat a number as currency:\n\n```php\n    $Formatter = new Currency();\n    echo $Formatter-\u003eformat( 5 );\n```php\n    $Formatter = new Currency();\n    $Formatter-\u003esetPadLength( 6 );\n    echo $Formatter-\u003eformat( 5 );    \n```\nOutput:\n\n    $__5.00\n\nFormat a number as currency with a custom currency symbol, pad character and pad length:\n\n```php\n    $Formatter = new Currency();\n    $Formatter-\u003esetCurrencySymbol( \"£\" );\n    $Formatter-\u003esetPadLength( 11 );\n    $Formatter-\u003esetPadCharacter( '-' );\n```\nOutput:\n\n    £-------5.00\n\n### Date\n\nFormat a date:\n```php\n    $Formatter = new Date();\n    echo $Formatter-\u003eformat( '12/23/2024' )\n```\nOutput:\n\n    2024-12-23\n \nFormat a date with a custom format:   \n```php\n    $Formatter = new Date();\n    $Formatter-\u003esetFormat( 'd/m/Y' );\n    echo $Formatter-\u003eformat( '12/23/2024' )\n````\n\nOutput:\n\n    23/12/2024\n\n### DateTime\n\nFormat a date and time:\n```php    \t\t\t\n    $Formatter = new DateTime();\n    echo $Formatter-\u003eformat( '12/23/2024 13:30' )\n```\nOutput:\n\n    2024-12-24 1:30 pm\n\nFormat a date and time with a custom format:\n```php\n    $Formatter = new DateTime();\n    $Formatter-\u003esetFormat( 'd/m/Y H:i' );\n    echo $Formatter-\u003eformat( '12/23/2024 13:30' )\n```\n\nOutput:\n\n    23/12/2024 13:30\n\n### Time\n\nFormat a time:\n```php\n    $Formatter = new Time();\n    echo $Formatter-\u003eformat( '13:30' )\n```\nOutput\n\n    1:30 pm\n\nFormat a time with a custom format:\n```php\n    $Formatter = new Time();\n    $Formatter-\u003esetFormat( 'H:i:s' );\n    $Formatter-\u003eformat( '13:30:40' )\n```\n\nOutput:\n\n    13:30:40\n\n### PhoneNumber\n\nFormat a 10-digit phone number:\n```php\n    $Formatter = new PhoneNumber();\n    echo $Formatter-\u003eformat( \"1234567890\" )\n```\nOutput:\n\n\t(123) 456-7890\n\nFormat a phone 7-digit phone number:\n```php\n    $Formatter = new PhoneNumber();\n    echo $Formatter-\u003eformat( \"1234567\" )\n```\n\nOutput:\n\n\t123-4567\n\nFormat an international phone number:\n```php\n    $Formatter = new PhoneNumber();\n    echo $Formatter-\u003eformat( \"12345678901234567890\" )\n```\n\nOutput:\n\n    +12 34 567 89012\n\n# More Information\n\nYou can read more about the Neuron components at [neuronphp.com](http://neuronphp.com)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fneuron-php%2Fformatting","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fneuron-php%2Fformatting","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fneuron-php%2Fformatting/lists"}