{"id":13508793,"url":"https://github.com/joshdholtz/ecto-lazy-float","last_synced_at":"2025-06-25T07:38:38.461Z","repository":{"id":27365644,"uuid":"30841110","full_name":"joshdholtz/ecto-lazy-float","owner":"joshdholtz","description":"Ecto.LazyFloat - An Ecto.Float that accepts binary and integers","archived":false,"fork":false,"pushed_at":"2018-02-15T20:07:48.000Z","size":168,"stargazers_count":7,"open_issues_count":1,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-28T16:59:18.334Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Elixir","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/joshdholtz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-02-15T20:36:15.000Z","updated_at":"2024-04-29T04:05:52.000Z","dependencies_parsed_at":"2022-08-28T17:02:41.757Z","dependency_job_id":null,"html_url":"https://github.com/joshdholtz/ecto-lazy-float","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joshdholtz%2Fecto-lazy-float","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joshdholtz%2Fecto-lazy-float/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joshdholtz%2Fecto-lazy-float/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joshdholtz%2Fecto-lazy-float/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/joshdholtz","download_url":"https://codeload.github.com/joshdholtz/ecto-lazy-float/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243976478,"owners_count":20377691,"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-08-01T02:00:58.555Z","updated_at":"2025-03-19T08:31:06.780Z","avatar_url":"https://github.com/joshdholtz.png","language":"Elixir","funding_links":[],"categories":["ORM and Datamapping"],"sub_categories":[],"readme":"# Ecto.LazyFloat\nEcto.LazyFloat - An Ecto.Float that accepts binary and integers\n\nFind on Hex - https://hex.pm/packages/ecto_lazy_float\n\n## Installation\nAdd Ecto.LazyFloat as a dependency in your `mix.exs` file.\n\n```elixir\ndefp deps do\n  [{:postgrex, \"\u003e= 0.0.0\"},\n   {:ecto, \"~\u003e 0.7\"},\n   {:ecto_lazy_float, \"~\u003e 0.1.2\"}]\nend\n```\n\nAfter you are done, run `mix deps.get` in your shell to fetch the dependencies.\n\n## Usage\n\nEnable LazyFloat through an Ecto model schema:\n\n```elixir\ndefmodule YourProject.Thing do\n  use Ecto.Model\n\n  schema \"things\" do\n    field :notes, :string\n    field :position, :integer\n    field :value, Ecto.LazyFloat\n  end\nend\n```\n\n```elixir\n# With integer\nvalid = Ecto.Changeset.cast(%{value: 1}, %Thing{}, [], [])\nRepo.insert(valid)\n\n# With string\nvalid = Ecto.Changeset.cast(%{value: \"1.2\"}, %Thing{}, [], [])\nRepo.insert(valid)\n\n# With float\nvalid = Ecto.Changeset.cast(%{value: 1.2}, %Thing{}, [], [])\nRepo.insert(valid)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoshdholtz%2Fecto-lazy-float","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjoshdholtz%2Fecto-lazy-float","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoshdholtz%2Fecto-lazy-float/lists"}