Modify

Opened 3 months ago

#24410 new enhancement

Increase "Length Step" (tlenstep) precision

Reported by: Lumikeiju Owned by: team
Priority: minor Milestone:
Component: Plugin buildings_tools Version: latest
Keywords: Cc:

Description

Rationale
1 ft = 0.3048 m, but when the value 0.3048 is entered in the building_tools plugin's BuildingSizeDialog "Length step" (tlenstep) field, it is rounded to 0.305 and this causes a compounding error resulting in lengths like 100.07 ft when 100 ft is intended.

Fix
Use setMaximumFractionDigits() to support 4 decimal points:

    private final JFormattedTextField tlenstep = new JFormattedTextField(NumberFormat.getInstance());
    {
        ((NumberFormat) tlenstep.getFormatter()).setMaximumFractionDigits(4);
    }

in https://josm.openstreetmap.de/osmsvn/applications/editors/josm/plugins/buildings_tools/src/org/openstreetmap/josm/plugins/buildings_tools/BuildingSizeDialog.java

Attachments (1)

BuildingSizeDialog.java (4.9 KB ) - added by Lumikeiju 3 months ago.
Updated BuildingSizeDialog.java for building_tools plugin: support 4 decimal places

Download all attachments as: .zip

Change History (1)

by Lumikeiju, 3 months ago

Attachment: BuildingSizeDialog.java added

Updated BuildingSizeDialog.java for building_tools plugin: support 4 decimal places

Modify Ticket

Change Properties
Set your email in Preferences
Action
as new The owner will remain team.
as The resolution will be set. Next status will be 'closed'.
to The owner will be changed from team to the specified user.
Next status will be 'needinfo'. The owner will be changed from team to Lumikeiju.
as duplicate The resolution will be set to duplicate. Next status will be 'closed'. The specified ticket will be cross-referenced with this ticket.
The owner will be changed from team to anonymous. Next status will be 'assigned'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.