diff --git a/bookstore/src/main/java/com/fjordtek/bookstore/model/Book.java b/bookstore/src/main/java/com/fjordtek/bookstore/model/Book.java index 73eca8e..3897e06 100644 --- a/bookstore/src/main/java/com/fjordtek/bookstore/model/Book.java +++ b/bookstore/src/main/java/com/fjordtek/bookstore/model/Book.java @@ -11,9 +11,10 @@ import javax.validation.constraints.Size; import javax.validation.constraints.Pattern; import javax.validation.constraints.NotNull; -import com.fjordtek.bookstore.validation.CurrentYear; +import com.fjordtek.bookstore.annotation.CurrentYear; import org.springframework.format.annotation.NumberFormat; +import org.springframework.format.annotation.NumberFormat.Style; //import java.sql.Timestamp; //import javax.validation.constraints.PastOrPresent; @@ -114,7 +115,7 @@ public class Book { ) private String isbn; - @NumberFormat(pattern = "#,###,###,###.##") + @NumberFormat(style = Style.NUMBER, pattern = "#,###.###") @Digits( integer = 3, fraction = 2, message = "Invalid price, possibly too many decimals" diff --git a/bookstore/src/main/resources/templates/bookadd.html b/bookstore/src/main/resources/templates/bookadd.html index 9c521ae..0b83f67 100644 --- a/bookstore/src/main/resources/templates/bookadd.html +++ b/bookstore/src/main/resources/templates/bookadd.html @@ -37,7 +37,12 @@
- +
+
+
+
+ +
Set book price
Invalid price
diff --git a/bookstore/src/main/resources/templates/bookedit.html b/bookstore/src/main/resources/templates/bookedit.html index 9fcbf56..6ed382a 100644 --- a/bookstore/src/main/resources/templates/bookedit.html +++ b/bookstore/src/main/resources/templates/bookedit.html @@ -36,8 +36,13 @@
Invalid year
-
- + +
+
+
+
+ +
Set book price
Invalid price