Skip to content

Commit

Permalink
Fix README cel expression
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanvanburen committed Dec 18, 2024
1 parent 9fc35f1 commit d29fb4c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ message Transaction {
string price = 4 [(buf.validate.field).cel = {
id: "transaction.price",
message: "price must be positive and include a valid currency symbol ($ or £)",
expression: "(this.startswith('$') or this.startswith('£')) and float(this[1:]) > 0"
expression: "(this.startsWith('$') || this.startsWith('£')) && double(this.substring(1)) > 0"
}];
option (buf.validate.message).cel = {
Expand Down

0 comments on commit d29fb4c

Please sign in to comment.