diff --git a/src/bin/psql/t/001_basic.pl b/src/bin/psql/t/001_basic.pl
index 56b1e3e4a6f..52b982a5f80 100644
--- a/src/bin/psql/t/001_basic.pl
+++ b/src/bin/psql/t/001_basic.pl
@@ -3,6 +3,7 @@
 
 use strict;
 use warnings;
+use locale;
 
 use PostgreSQL::Test::Cluster;
 use PostgreSQL::Test::Utils;
@@ -353,7 +354,7 @@ psql_like(
 # Check \watch
 psql_like(
 	$node,
-	'SELECT 1 \watch c=3 i=0.01',
+	sprintf('SELECT 1 \watch c=3 i=%g', 0.01),
 	qr/1\n1\n1/,
 	'\watch with 3 iterations');
 
