The project is in a healthy, maintained state
This gem allows you to format Ukrainian phone numbers from various input formats into a standard format.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies

Development

~> 13.0
~> 3.0
 Project Readme

Ukraine Phone Formatter

Gem Version GitHub Stars

Ukraine Phone Formatter is a simple Ruby gem that formats Ukrainian phone numbers into a readable and standardized format.

Installation

Add this line to your application's Gemfile:

gem 'ukraine_phone_formatter'

And then execute

bundle install

Or install it yourself with:

gem install ukraine_phone_formatter

Usage

require 'ukraine_phone_formatter'

formatted = UkrainePhoneFormatter.format('0631234567')
puts formatted
# Output: +38 (063) 123-45-67

formatted = UkrainePhoneFormatter.format('+380631234567')
puts formatted
# Output: +38 (063) 123-45-67

Input Formats

The gem accepts 10-digit Ukrainian numbers (e.g. "0631234567") and 12-digit international numbers starting with "38" (e.g. "380631234567" or "+380631234567").

Output Format

All valid numbers are formatted in the following way:

+38 (XXX) XXX-XX-XX

Invalid or unsupported numbers are returned as-is.

Development

Feel free to fork or contribute.

License

This project is licensed under the MIT License

Author