Skip to content
This repository has been archived by the owner on Jun 27, 2018. It is now read-only.

Commit

Permalink
Add float type
Browse files Browse the repository at this point in the history
  • Loading branch information
jpetitcolas committed May 28, 2015
1 parent edfd219 commit 89d6334
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/Factory.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import ChoicesField from "./Field/ChoicesField";
import DateField from "./Field/DateField";
import DateTimeField from "./Field/DateTimeField";
import EmailField from "./Field/EmailField";
import FloatField from "./Field/FloatField.js";
import FileField from "./Field/FileField";
import JsonField from "./Field/JsonField";
import NumberField from "./Field/NumberField";
Expand Down Expand Up @@ -89,6 +90,7 @@ class Factory {
this.registerFieldType('date', DateField);
this.registerFieldType('datetime', DateTimeField);
this.registerFieldType('email', EmailField);
this.registerFieldType('float', FloatField);
this.registerFieldType('string', Field);
this.registerFieldType('file', FileField);
this.registerFieldType('json', JsonField);
Expand Down
11 changes: 11 additions & 0 deletions lib/Field/FloatField.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import NumberField from "./NumberField";

class FloatField extends NumberField {
constructor(name) {
super(name);
this._type = 'float';
this._format = '0.000';
}
}

export default FloatField;

0 comments on commit 89d6334

Please sign in to comment.