Skip to content

Commit

Permalink
Merge pull request #71 from arkanoider/fix-orderlist
Browse files Browse the repository at this point in the history
Draft idea to fix listorders in case of - and . char
  • Loading branch information
grunch committed May 15, 2024
2 parents 702490f + 3dfac1d commit c80e9f1
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/nip33.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,17 @@ pub fn order_from_tags(tags: Vec<Tag>) -> Result<SmallOrder> {
order.amount = v.parse::<i64>().unwrap();
}
"fa" => {
order.fiat_amount = v.parse::<i64>().unwrap();
if v.contains('.') {
continue;
}
if v.contains('-') {
// Get values from string
let values: Vec<&str> = v.split('-').collect();
order.min_amount = values[0].parse::<i64>().ok();
order.max_amount = values[1].parse::<i64>().ok();
} else {
order.fiat_amount = v.parse::<i64>().unwrap();
}
}
"pm" => {
order.payment_method = v.to_string();
Expand Down

0 comments on commit c80e9f1

Please sign in to comment.