Mercurial > clickerconvert
comparison src/constants.h @ 55:aaaf8cdbc85c
Make percent string formatting more flexible
It now also responds to .94 or something like that and is prepared
for multiple numbers after the dot.
author | Andre Heinecke <andre.heinecke@intevation.de> |
---|---|
date | Wed, 20 Jul 2016 16:57:52 +0200 |
parents | a43d8cf2fa95 |
children | 5410f9f279ea |
comparison
equal
deleted
inserted
replaced
54:dcfb8e9d5ee9 | 55:aaaf8cdbc85c |
---|---|
61 * @brief Identifiying line that shows a question is a choice question. */ | 61 * @brief Identifiying line that shows a question is a choice question. */ |
62 #define CHOICE_IDENTIFIER "Answer,Votes,Percent" | 62 #define CHOICE_IDENTIFIER "Answer,Votes,Percent" |
63 | 63 |
64 /** | 64 /** |
65 * @brief The pattern used to match a multiple choice answer. */ | 65 * @brief The pattern used to match a multiple choice answer. */ |
66 #define CHOICE_PATTERN "\"(.*)\",(?<num>\\d+)?,(?<percent>\\d+\\.?\\d+)?" | 66 #define CHOICE_PATTERN "\"(.*)\",(?<num>\\d+)?,(?<percent>\\d{0,3}\\.{0,1}\\d*)?" |
67 | 67 |
68 /** | 68 /** |
69 * @brief The pattern used to match an unfilled choice answer. */ | 69 * @brief The pattern used to match an unfilled choice answer. */ |
70 #define CHOICE_UNFILLED_PATTERN "\"([^\"]*)\"," | 70 #define CHOICE_UNFILLED_PATTERN "\"([^\"]*)\"," |
71 | 71 |