to avoid implying that it's *only* quoted if that parameter is
truthy.
Also, check the boolean before looks_like_number call, as that is
more expensive to do.
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
(cherry picked from commit
b8608c53e773fad60d0008b0f1937e0cc5dd1c34)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
# 'abc' and '123' are both valid hostnames, that confuses influx's type detection
my $to_quote = { name => 1 };
+
my @values = ();
foreach my $key (sort keys %$data) {
}
sub prepare_value {
- my ($value, $quote) = @_;
+ my ($value, $force_quote) = @_;
# don't treat value like a number if quote is 1
- if (looks_like_number($value) && !$quote) {
+ if (!$force_quote && looks_like_number($value)) {
if (isnan($value) || isinf($value)) {
# we cannot send influxdb NaN or Inf
return undef;