[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Demexp-dev] Re: Issue to use ocaml-gettext with lablgtk
From: |
David MENTRE |
Subject: |
[Demexp-dev] Re: Issue to use ocaml-gettext with lablgtk |
Date: |
Tue, 24 Jan 2006 22:06:12 +0100 |
User-agent: |
Gnus/5.1006 (Gnus v5.10.6) Emacs/21.4 (gnu/linux) |
David MENTRE <address@hidden> writes:
> Yes, using LANG=C when calling my program solves the issue. But for my
> autotests, I need to do that *from* the program. Do you see a way to set
> the locale from OCaml, for a given part of the code?
Ok, I've found a work around, calling Printf.sprintf to generate the
result test. It is probably less clear than before but works across any
locale.
For those following demexp development, I've applied following patch:
- assert(time_as_string 0.000000001 = "1.000 ns");
- assert(time_as_string 0.000001 = "1.000 us");
- assert(time_as_string 0.001 = "1.000 ms");
- assert(time_as_string 1. = "1.000 s");
+ assert(time_as_string 0.000000001 = Printf.sprintf "%.3f ns" 1.0);
+ assert(time_as_string 0.000001 = Printf.sprintf "%.3f us" 1.0);
+ assert(time_as_string 0.001 = Printf.sprintf "%.3f ms" 1.0);
+ assert(time_as_string 1. = Printf.sprintf "%.3f s" 1.0);
Best wishes,
d.
--
address@hidden