# Bug Tracker

ID: 15 🔗 Closed (Fixed) datatool 2.11 2013-01-08 14:01:20 DTLgetvalueforkey fails when key=0

## Report

Thank you for datatool!; it has revolutionized my workflow.

Please see the attached MWE.. pdflatex output looks like:

5.045455
Undefined Value
23.227273
32.318182
41.409091


### MWE

\documentclass[11pt,letterpaper]{article}

\usepackage{filecontents}
\begin{filecontents*}{data.out}
LOGDISTANCE,distance,barnum
-1,0.100000,5.045455
0,1.000000,14.136364
1,10.000000,23.227273
2,100.000000,32.318182
3,1000.000000,41.409091
4,10000.000000,50.500000
\end{filecontents*}

\usepackage{datatool}

\listfiles

\begin{document}

\DTLgetvalueforkey\Onekm{barnum}{MyDBase}{LOGDISTANCE}{-1} \Onekm

\DTLgetvalueforkey\Onekm{barnum}{MyDBase}{LOGDISTANCE}{0} \Onekm

\DTLgetvalueforkey\Onekm{barnum}{MyDBase}{LOGDISTANCE}{1} \Onekm

\DTLgetvalueforkey\Onekm{barnum}{MyDBase}{LOGDISTANCE}{2} \Onekm

\DTLgetvalueforkey\Onekm{barnum}{MyDBase}{LOGDISTANCE}{3} \Onekm

\end{document}


## Evaluation

The test for null was incorrectly interpreting 0 as a null value. Fixed in v2.13 (2013-01-15).

Comment from OP
Date: 2013-03-15 00:45:29 CDT

Thanks!

## Watch This Report

If you supply your name, it will be used in the email greeting, which provides a more personal message, otherwise you'll just get a generic greeting. If you have previously supplied your name when signing up for notifications, you don't need to resupply it unless you want to change it.

If you have previously subscribed to notifications for this report, you can unsubscribe by clicking on the "Stop Notification" button.

The "Confirm Bug ID" field helps to protect against spambots. Please enter the bug ID (which you can find at the top of this page).

Name: (Optional.)