{"id":19015459,"url":"https://github.com/hansolo/formattedtextfield","last_synced_at":"2025-04-23T01:48:47.044Z","repository":{"id":145343423,"uuid":"234528270","full_name":"HanSolo/formattedtextfield","owner":"HanSolo","description":"A custom JavaFX TextField that allows custom formatting","archived":false,"fork":false,"pushed_at":"2020-04-20T07:32:40.000Z","size":266,"stargazers_count":12,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-23T01:48:24.199Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/HanSolo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"license.txt","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}},"created_at":"2020-01-17T10:42:43.000Z","updated_at":"2023-12-13T21:03:17.000Z","dependencies_parsed_at":null,"dependency_job_id":"6b3a3770-48a3-4c85-92e8-721e88465089","html_url":"https://github.com/HanSolo/formattedtextfield","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HanSolo%2Fformattedtextfield","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HanSolo%2Fformattedtextfield/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HanSolo%2Fformattedtextfield/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HanSolo%2Fformattedtextfield/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/HanSolo","download_url":"https://codeload.github.com/HanSolo/formattedtextfield/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250354291,"owners_count":21416751,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2024-11-08T19:37:25.518Z","updated_at":"2025-04-23T01:48:46.993Z","avatar_url":"https://github.com/HanSolo.png","language":"Java","funding_links":["https://paypal.me/hans0l0"],"categories":[],"sub_categories":[],"readme":"## Formatted TextField\nA JavaFX custom TextField that allows formatting numbers with custom formats and units.\n\nDonations are welcome at [Paypal](https://paypal.me/hans0l0)\n\n## Description\nIf you need a text field that shows for example the international short form for US dollars behind the value you can create the field as follows:\n\n`new FormattedTextField(new Format(StandardType.DOLLAR), 5, 2, Locale.US, true)`\n\nThis field now is allowed to have 5 digits before the decimal separator and 2 digits after the decimal separator.\nBecause we set the locale to Locale.US you are only allowed to use the \".\" as decimal separator.\nIn this field also negative numbers are allowed which is indicated by the last boolean value.\n\nIf you need a text field that shows the same but for Euros it could look like follows:\n\n`new FormattedTextField(new Format(StandardType.EURO), 5, 2, Locale.GERMANY, false)`\n\nThis field now will show EUR behind the value when not focused and only the \",\" is allowed as decimal separator\nbecause we choose Locale.GERMANY. In this field you cannot type in negative numbers.\n\nThe field also supports the plural form for units. Let's say you would like to have the units be months.\nIn case you type in 1 the field will show \"1 Month\" on focus lost.\nIf you type in 2 the field will now show \"2 Months\" on focus lost.\n\nThere are some standard types defined in the class StandardType which are the following:\n* NONE(\"0\", \"\", \"\")\n* KM(\"#,###,##0.00\", \" KM\", \"in Kilometers\")\n* PERCENTAGE(\"0.0\", \" %\", \"in percentage\")\n* YEARS(\"0\", \" Year\", \" Years\", \"in years\")\n* MONTHS(\"0\", \" Month\", \" Months\", \"in months\")\n* EURO(\"0.00\", \" EUR\", \"in Euro\")\n* DOLLAR(\"0.00\", \" USD\", \"in Dollar\")\n\nDefine your own format as follows, lets say you would like to create a format for \nGallons it could look like this:\n`new Format(\"0.0\", \"Gallon\", \"Gallons\", \"in Gallons\", Locale.US)` \n\nIf you now would like to create a FormattedTextField with this Gallon Format it should look as follows:\n\n`new FormattedTextField(new Format(\"0.0\", \"Gallon\", \"Gallons\", \"in Gallons\", Locale.US), 3, 2, Locale.US, false)`\n\n## Overview\n![Overview](https://raw.githubusercontent.com/HanSolo/formattedtextfield/master/FormattedTextField.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhansolo%2Fformattedtextfield","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhansolo%2Fformattedtextfield","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhansolo%2Fformattedtextfield/lists"}