History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: BOO-425
Type: Improvement Improvement
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Doug H
Reporter: Doug H
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Boo

Digit grouping for readability

Created: 07/Aug/05 02:13 AM   Updated: 21/Oct/05 05:41 PM
Component/s: Parser
Affects Version/s: 0.5.6
Fix Version/s: 0.7.5

Time Tracking:
Not Specified

File Attachments: 1. Text File grouping.patch (2 kb)

Issue Links:
dependent
 

Testcase included: yes


 Description  « Hide
From the thread on boolang here: http://groups-beta.google.com/group/boolang/browse_frm/thread/dc389436c6463bdb/7a9708de1b21d23c

This patch allows you to use spaces to group digits in long numbers to aid readability, like in the examples below. It can easily be changed to allow underscores instead of spaces (or both).

n = 1 000 000
n2 = 1 000 .00 //can't have space after decimal point
n3 = 1 000 000 ms //timespans and other literals work
n4 = .0 0 1 //only one space allowed btw each number
n5 = 1 000 L



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Cameron Kenneth Knight - 14/Oct/05 09:00 AM
I think it would be better to use underscores, ala Ruby.

n = 1_000_000
n2 = 1_000__00 // fail

I wouldn't want to deal with debugging whitespace if I accidentally press space twice. At least underscore (_) is a viewable character.


Rodrigo B. de Oliveira - 14/Oct/05 10:48 AM
I agree with Cameron.

Let's make it _?