From 3cfac7916a4d3708f231875ade0cd5e586ec43e6 Mon Sep 17 00:00:00 2001 From: John Benediktsson Date: Tue, 5 Aug 2014 11:39:03 -0700 Subject: [PATCH] calendar.format: change to use formatting instead of math.parser.private. --- basis/calendar/format/format.factor | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/basis/calendar/format/format.factor b/basis/calendar/format/format.factor index 774d8121a6..837e43a64c 100644 --- a/basis/calendar/format/format.factor +++ b/basis/calendar/format/format.factor @@ -1,9 +1,8 @@ ! Copyright (C) 2008, 2010 Slava Pestov, Doug Coleman. ! See http://factorcode.org/license.txt for BSD license. USING: accessors arrays calendar calendar.format.macros -combinators io io.streams.string kernel math math.functions -math.order math.parser math.parser.private present sequences -typed ; +combinators formatting io io.streams.string kernel math +math.functions math.order math.parser present sequences typed ; IN: calendar.format : pad-00 ( n -- str ) number>string 2 CHAR: 0 pad-head ; @@ -138,7 +137,7 @@ M: timestamp year. ( timestamp -- ) ! algorithm to detect infinite decimals (e.g 1/3) : write-rfc3339-seconds ( timestamp -- ) second>> 1 mod [ - >float "%.6f" format-float [ CHAR: 0 = ] trim + "%.6f" sprintf [ CHAR: 0 = ] trim dup length 1 > [ write ] [ drop ] if ] unless-zero ;